summaryrefslogtreecommitdiff
path: root/mkfs.ubifs
diff options
context:
space:
mode:
Diffstat (limited to 'mkfs.ubifs')
-rw-r--r--mkfs.ubifs/lpt.c2
-rw-r--r--mkfs.ubifs/mkfs.ubifs.c5
2 files changed, 4 insertions, 3 deletions
diff --git a/mkfs.ubifs/lpt.c b/mkfs.ubifs/lpt.c
index c8fb22c..f6d4352 100644
--- a/mkfs.ubifs/lpt.c
+++ b/mkfs.ubifs/lpt.c
@@ -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);
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;