summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/e2fsprogs/e2fsprogs/misc-mke2fs.c-return-error-when-failed-to-populate-fs.patch
blob: 9b467c338cded8ed57abf13bdf5a8ea04bd7a717 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
From e4ffd6fe975888d306b5f700ba54af18b59f6759 Mon Sep 17 00:00:00 2001
From: Robert Yang <liezhi.yang@windriver.com>
Date: Thu, 20 Mar 2014 11:10:21 +0800
Subject: [PATCH] misc/mke2fs.c: return error when failed to populate filesystem

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

Upstream-Status Submitted

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

diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index a63f0b7..846190e 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -2745,10 +2745,11 @@ no_journal:
 		current_fs = fs;
 		root = EXT2_ROOT_INO;
 		retval = populate_fs(root, root_dir);
-		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