]> www.infradead.org Git - mtd-utils.git/commitdiff
mkfs.ubifs: eliminate compiler warnings
authorAdrian Hunter <ext-adrian.hunter@nokia.com>
Thu, 12 Feb 2009 08:53:18 +0000 (10:53 +0200)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Thu, 12 Feb 2009 10:42:19 +0000 (12:42 +0200)
The warnings were:

lpt.c: In function ‘create_lpt’:
lpt.c:552: warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘long long int’
mkfs.ubifs.c: In function ‘do_openat’:
mkfs.ubifs.c:251: warning: ignoring return value of ‘chdir’, declared with attribute warn_unused_result
mkfs.ubifs.c: In function ‘get_options’:
mkfs.ubifs.c:542: warning: format not a string literal and no format arguments

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
mkfs.ubifs/lpt.c
mkfs.ubifs/mkfs.ubifs.c

index c8fb22cbc73d850041d32569314c38c392021653..f6d43522eb3632b8e1d763d1ee18187dce8e1dcd 100644 (file)
@@ -549,7 +549,7 @@ int create_lpt(struct ubifs_info *c)
        c->nhead_lnum = lnum;
        c->nhead_offs = ALIGN(len, c->min_io_size);
 
-       dbg_msg(1, "lpt_sz:         %d", c->lpt_sz);
+       dbg_msg(1, "lpt_sz:         %lld", c->lpt_sz);
        dbg_msg(1, "space_bits:     %d", c->space_bits);
        dbg_msg(1, "lpt_lnum_bits:  %d", c->lpt_lnum_bits);
        dbg_msg(1, "lpt_offs_bits:  %d", c->lpt_offs_bits);
index 6c4e9127653e70ef75f703785214dcb0098d0b28..bedf8a7e4135a4b65157ecaecaa3601a2e72e96f 100644 (file)
@@ -248,7 +248,8 @@ static int do_openat(int fd, const char *path, int flags)
        ret = fchdir(fd);
        if (ret != -1)
                ret = open(path, flags);
-       chdir(cwd);
+       if (chdir(cwd) && !ret)
+               ret = -1;
        free(cwd);
        return ret;
 }
@@ -539,7 +540,7 @@ static int get_options(int argc, char**argv)
                        break;
                case 'h':
                case '?':
-                       printf(helptext);
+                       printf("%s", helptext);
                        exit(0);
                case 'v':
                        verbose = 1;