e2fsprogs: return error when failed to populate fs
We need return retval when "mke2fs -d" failed, otherwise the "$?" would be 0 which is misleading. [YOCTO #6011] (From OE-Core rev: 46896b601c1c93e276954b674aa30b8b4dc4f611) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
d5982a28b1
commit
21a3ffb2dc
|
@ -0,0 +1,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
|
||||
|
|
@ -17,6 +17,7 @@ SRC_URI += "file://acinclude.m4 \
|
|||
file://0010-debugfs-use-the-functions-in-misc-create_inode.c.patch \
|
||||
file://0011-mke2fs.8.in-update-the-manual-for-the-d-option.patch \
|
||||
file://0001-e2fsprogs-fix-cross-compilation-problem.patch \
|
||||
file://misc-mke2fs.c-return-error-when-failed-to-populate-fs.patch \
|
||||
"
|
||||
|
||||
SRC_URI[md5sum] = "3f8e41e63b432ba114b33f58674563f7"
|
||||
|
|
Loading…
Reference in New Issue