[PATCH] e2fsprogs: misc/mke2fs.c: return error when failed to populate fs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Robert Yang <liezhi.yang@xxxxxxxxxxxxx>
---
 misc/mke2fs.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index aecd5d5..f659e6f 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -2990,10 +2990,11 @@ no_journal:
 
 		retval = populate_fs(fs, EXT2_ROOT_INO, root_dir,
 				     EXT2_ROOT_INO);
-		if (retval)
+		if (retval) {
 			fprintf(stderr, "%s",
-				_("\nError while populating file system"));
-		else if (!quiet)
+				_("\nError while populating file system\n"));
+			return retval;
+		} else if (!quiet)
 			printf("%s", _("done\n"));
 	}
 
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux