lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1395885787-25947-1-git-send-email-liezhi.yang@windriver.com>
Date:	Thu, 27 Mar 2014 10:03:07 +0800
From:	Robert Yang <liezhi.yang@...driver.com>
To:	<tytso@....edu>
CC:	<linux-ext4@...r.kernel.org>, <gnehzuil.liu@...il.com>
Subject: [PATCH V2] e2fsprogs: misc/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@...driver.com>
---
 misc/mke2fs.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index aecd5d5..60e7466 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)
-			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"));
 	}
 
-- 
1.8.3.1

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ