From: Steve Dickson <SteveD@redhat.com>
To: Karel Zak <kzak@redhat.com>, linux-nfs@vger.kernel.org
Subject: Re: [PATCH] umount: make it sensitive to -v
Date: Fri, 24 Oct 2014 09:37:48 -0400 [thread overview]
Message-ID: <544A562C.3090204@RedHat.com> (raw)
In-Reply-To: <1414145000-16669-1-git-send-email-kzak@redhat.com>
On 10/24/2014 06:03 AM, Karel Zak wrote:
> Let's print verbose messages like original non-libmount version.
>
> Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=923582
> Signed-off-by: Karel Zak <kzak@redhat.com>
Committed.... Thanks!
steved.
> ---
> utils/mount/mount_libmount.c | 14 +++++++++++++-
> 1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/utils/mount/mount_libmount.c b/utils/mount/mount_libmount.c
> index 6f85dc9..fa46d54 100644
> --- a/utils/mount/mount_libmount.c
> +++ b/utils/mount/mount_libmount.c
> @@ -174,7 +174,7 @@ static int umount_main(struct libmnt_context *cxt, int argc, char **argv)
> {
> int rc, c;
> char *spec = NULL, *opts = NULL;
> - int ret = EX_FAIL;
> + int ret = EX_FAIL, verbose = 0;
>
> static const struct option longopts[] = {
> { "force", 0, 0, 'f' },
> @@ -201,6 +201,8 @@ static int umount_main(struct libmnt_context *cxt, int argc, char **argv)
> return EX_USAGE;
> }
>
> + verbose = mnt_context_is_verbose(cxt);
> +
> if (optind < argc)
> spec = argv[optind++];
>
> @@ -228,6 +230,10 @@ static int umount_main(struct libmnt_context *cxt, int argc, char **argv)
> goto err;
> }
>
> + if (verbose)
> + printf(_("%s: %s mount point detected\n"), spec,
> + mnt_context_get_fstype(cxt));
> +
> opts = retrieve_mount_options(mnt_context_get_fs(cxt));
>
> if (!mnt_context_is_lazy(cxt)) {
> @@ -263,6 +269,12 @@ static int umount_main(struct libmnt_context *cxt, int argc, char **argv)
> }
> ret = EX_SUCCESS;
> err:
> + if (verbose) {
> + if (ret == EX_SUCCESS)
> + printf(_("%s: umounted\n"), spec);
> + else
> + printf(_("%s: umount failed\n"), spec);
> + }
> free(opts);
> return ret;
> }
>
prev parent reply other threads:[~2014-10-24 13:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-24 10:03 [PATCH] umount: make it sensitive to -v Karel Zak
2014-10-24 13:37 ` Steve Dickson [this message]
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=544A562C.3090204@RedHat.com \
--to=steved@redhat.com \
--cc=kzak@redhat.com \
--cc=linux-nfs@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox