]> www.infradead.org Git - mtd-utils.git/commitdiff
ubi-utils: get rid of compile warnings
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Wed, 29 Aug 2007 15:51:07 +0000 (18:51 +0300)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Wed, 29 Aug 2007 15:51:07 +0000 (18:51 +0300)
Just silly hacks. Also remove udevsettle() invocation from UBI
library. If it must be called, it is not library's business
anyway. Wa added it to make scripts which use ubimkvol utility
run, so it is the only caller that really needs this. So
just move the cruft to the utility.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
ubi-utils/src/bin2nand.c
ubi-utils/src/libubi.c
ubi-utils/src/pfi2bin.c
ubi-utils/src/ubimkvol.c

index 7c4c816d10bc6cc775ce755f2d5fbda03085fa1c..cf691912f3047f6435dbd12de4b41b416eca7fb5 100644 (file)
@@ -228,14 +228,14 @@ process_page(uint8_t* buf, size_t pagesize,
 
        /* either separate oob or interleave with data */
        if (fp_oob) {
-               fwrite(oobbuf, 1, oobsize, fp_oob);
+               i = fwrite(oobbuf, 1, oobsize, fp_oob);
                if (ferror(fp_oob)) {
                        err_msg("IO error\n");
                        return -EIO;
                }
        }
        else {
-               fwrite(oobbuf, 1, oobsize, fp_data);
+               i = fwrite(oobbuf, 1, oobsize, fp_data);
                if (ferror(fp_data)) {
                        err_msg("IO error\n");
                        return -EIO;
index 06cf52a6a2be21a24210dc2ef061e3290d74e554..a028fc6dde7aca2e2464e34484fb0ebdb9d5379d 100644 (file)
@@ -275,11 +275,6 @@ int ubi_mkvol(libubi_t desc, const char *node, struct ubi_mkvol_request *req)
        if (!ret)
                req->vol_id = r.vol_id;
 
-#if 1
-       /* This is a hack to work around udev problems */
-       system("udevsettle");
-#endif
-
        close(fd);
        return ret;
 }
index 57c4ea5c5d11b411c33c8c4114d6f3e8d9e48d93..6d5b21084f5a282767bab093936aabcc6d6ddabb 100644 (file)
@@ -320,11 +320,12 @@ static FILE*
 my_fmemopen (void *buf, size_t size, const char *opentype)
 {
     FILE* f;
+    size_t ret;
 
     assert(strcmp(opentype, "r") == 0);
 
     f = tmpfile();
-    fwrite(buf, 1, size, f);
+    ret = fwrite(buf, 1, size, f);
     rewind(f);
 
     return f;
index db57a936360adfe035c4d85f773cd355aa680609..ad58cc92e8f562fb8633131e79bb24298791c2e3 100644 (file)
@@ -333,6 +333,14 @@ int main(int argc, char * const argv[])
                goto out_libubi;
        }
 
+       /*
+        * This is hacky, but we want to wait until udev has created device
+        * nodes. There is probably better way do do this, though.
+        */
+       if (system("udevsettle")) {
+               /* Well, this is to keep GCC silent */
+       }
+
        /* printf("Created volume %d, %lld bytes, type %s, name %s\n",
           vol_id, bytes, vol_type == UBI_DYNAMIC_VOLUME ?
           "dynamic" : "static", name); */