From: Zheng Liu <gnehzuil.liu@gmail.com>
To: Robert Yang <liezhi.yang@windriver.com>
Cc: tytso@mit.edu, linux-ext4@vger.kernel.org
Subject: Re: [PATCH V2] e2fsprogs: misc/mke2fs.c: return error when failed to populate fs
Date: Sun, 30 Mar 2014 17:08:25 +0800 [thread overview]
Message-ID: <20140330090825.GA4394@gmail.com> (raw)
In-Reply-To: <1395885787-25947-1-git-send-email-liezhi.yang@windriver.com>
On Thu, Mar 27, 2014 at 10:03:07AM +0800, Robert Yang wrote:
> 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>
Thanks for fixing this.
Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
- Zheng
> ---
> 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
>
next prev parent reply other threads:[~2014-03-30 9:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-27 2:03 [PATCH V2] e2fsprogs: misc/mke2fs.c: return error when failed to populate fs Robert Yang
2014-03-30 9:08 ` Zheng Liu [this message]
2014-04-14 15:44 ` Theodore Ts'o
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140330090825.GA4394@gmail.com \
--to=gnehzuil.liu@gmail.com \
--cc=liezhi.yang@windriver.com \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.