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>
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"));
}