aboutsummaryrefslogtreecommitdiff
path: root/ubi-utils
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2007-08-29 18:51:07 +0300
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2007-08-29 18:51:07 +0300
commit914e5f6e143d7d9e5bd661218d503bd573163eb7 (patch)
tree9835db1fe89bb79f9f75f03f02d1798afa29c646 /ubi-utils
parent3f171e39e8c17d673fc9dea3364857c7e611c626 (diff)
ubi-utils: get rid of compile warnings
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>
Diffstat (limited to 'ubi-utils')
-rw-r--r--ubi-utils/src/bin2nand.c4
-rw-r--r--ubi-utils/src/libubi.c5
-rw-r--r--ubi-utils/src/pfi2bin.c3
-rw-r--r--ubi-utils/src/ubimkvol.c8
4 files changed, 12 insertions, 8 deletions
diff --git a/ubi-utils/src/bin2nand.c b/ubi-utils/src/bin2nand.c
index 7c4c816..cf69191 100644
--- a/ubi-utils/src/bin2nand.c
+++ b/ubi-utils/src/bin2nand.c
@@ -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;
diff --git a/ubi-utils/src/libubi.c b/ubi-utils/src/libubi.c
index 06cf52a..a028fc6 100644
--- a/ubi-utils/src/libubi.c
+++ b/ubi-utils/src/libubi.c
@@ -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;
}
diff --git a/ubi-utils/src/pfi2bin.c b/ubi-utils/src/pfi2bin.c
index 57c4ea5..6d5b210 100644
--- a/ubi-utils/src/pfi2bin.c
+++ b/ubi-utils/src/pfi2bin.c
@@ -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;
diff --git a/ubi-utils/src/ubimkvol.c b/ubi-utils/src/ubimkvol.c
index db57a93..ad58cc9 100644
--- a/ubi-utils/src/ubimkvol.c
+++ b/ubi-utils/src/ubimkvol.c
@@ -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); */