summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2007-07-16 16:29:17 -0400
committerNeil Brown <neilb@suse.de>2007-07-20 16:10:57 +1000
commit8d85f209d0343cf8fef35ea0c94ba9c93af6ffa6 (patch)
treec3b290d399f41d73886855ceb15289246c8c5ace
parentc940b820c790d7c595f92e3c8eb59a1b4adf5f96 (diff)
downloadnfs-utils-8d85f209d0343cf8fef35ea0c94ba9c93af6ffa6.tar.gz
nfs-utils-8d85f209d0343cf8fef35ea0c94ba9c93af6ffa6.tar.xz
nfs-utils-8d85f209d0343cf8fef35ea0c94ba9c93af6ffa6.zip
mount.nfs: When -v is set and the mount succeeds, print the mount info
Add a bit of logic that appears to be in other mount helpers. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
-rw-r--r--utils/mount/mount.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/utils/mount/mount.c b/utils/mount/mount.c
index da5482b..dde4562 100644
--- a/utils/mount/mount.c
+++ b/utils/mount/mount.c
@@ -171,6 +171,18 @@ static void discover_nfs_mount_data_version(void)
nfs_mount_data_version = NFS_MOUNT_VERSION;
}
+static void print_one(char *spec, char *node, char *type, char *opts)
+{
+ if (verbose) {
+ printf("%s on %s type %s", spec, node, type);
+
+ if (opts != NULL)
+ printf(" (%s)", opts);
+
+ printf("\n");
+ }
+}
+
/* Try to build a canonical options string. */
static char * fix_opts_string (int flags, const char *extra_opts) {
const struct opt_map *om;
@@ -475,6 +487,9 @@ int main(int argc, char *argv[])
if (mnt_err)
exit(EX_FAIL);
+ if (!fake)
+ print_one(spec, mount_point, fs_type, mount_opts);
+
if (!nomtab)
mnt_err = add_mtab(spec, mount_point, fs_type, flags, extra_opts,
0, 0 /* these are always zero for NFS */ );