summaryrefslogtreecommitdiff
path: root/mkfs.ubifs/mkfs.ubifs.c
diff options
context:
space:
mode:
authorAdrian Hunter <ext-adrian.hunter@nokia.com>2009-02-12 10:53:18 +0200
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2009-02-12 12:42:19 +0200
commit6bd4de4228044315d4271af58761792aef762ac9 (patch)
tree15f7c53b6f3ccab1d2eaca47a11fe7073877a353 /mkfs.ubifs/mkfs.ubifs.c
parentc4c6a59eb11db9b38c86bc26575a23dbac2e616f (diff)
mkfs.ubifs: eliminate compiler warnings
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>
Diffstat (limited to 'mkfs.ubifs/mkfs.ubifs.c')
-rw-r--r--mkfs.ubifs/mkfs.ubifs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mkfs.ubifs/mkfs.ubifs.c b/mkfs.ubifs/mkfs.ubifs.c
index 6c4e912..bedf8a7 100644
--- a/mkfs.ubifs/mkfs.ubifs.c
+++ b/mkfs.ubifs/mkfs.ubifs.c
@@ -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;