mke2fs.c: return error when failed to populate fs

We need return retval when "mke2fs -d" failed, otherwise the "$?"
would be 0 which is misleading.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
crypto
Robert Yang 2014-04-14 11:43:24 -04:00 committed by Theodore Ts'o
parent 7a5081dc30
commit 2af0221537
1 changed files with 5 additions and 4 deletions

View File

@ -2990,10 +2990,11 @@ no_journal:
retval = populate_fs(fs, EXT2_ROOT_INO, root_dir,
EXT2_ROOT_INO);
if (retval)
fprintf(stderr, "%s",
_("\nError while populating file system"));
else if (!quiet)
if (retval) {
com_err(program_name, retval, "%s",
_("\nError while populating file system\n"));
exit(1);
} else if (!quiet)
printf("%s", _("done\n"));
}