diff options
author | Karel Zak <kzak@redhat.com> | 2014-10-24 09:28:57 -0400 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2014-10-24 09:28:57 -0400 |
commit | a34ded08b39cc29652030a3f0a16c13ea977d9cb (patch) | |
tree | f5f631ffe0c0aeafddd7efdc6537afaec0db32b1 | |
parent | 86d33d888cd4f23a1816d4806627271ce062d9a3 (diff) | |
download | nfs-utils-a34ded08b39cc29652030a3f0a16c13ea977d9cb.tar.gz nfs-utils-a34ded08b39cc29652030a3f0a16c13ea977d9cb.tar.xz nfs-utils-a34ded08b39cc29652030a3f0a16c13ea977d9cb.zip |
umount: make it sensitive to -v
Let's print verbose messages like original non-libmount version.
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r-- | utils/mount/mount_libmount.c | 14 |
1 files changed, 13 insertions, 1 deletions
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; } |