summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKinglong Mee <kinglongmee@gmail.com>2014-06-01 12:51:02 -0400
committerSteve Dickson <steved@redhat.com>2014-06-01 13:10:02 -0400
commit548bbdc49b1f5dfbe7ba75d20c5791652dfeb125 (patch)
tree379549e3049d811a9aa1c5bf69625fc777fd624e
parent25e83c2270b2d2966c992885faed0b79be09f474 (diff)
downloadnfs-utils-548bbdc49b1f5dfbe7ba75d20c5791652dfeb125.tar.gz
nfs-utils-548bbdc49b1f5dfbe7ba75d20c5791652dfeb125.tar.xz
nfs-utils-548bbdc49b1f5dfbe7ba75d20c5791652dfeb125.zip
mount.nfs: print more useful error message
When mounting spec of a regular file, mount.nfs print error message as, mount.nfs: mount point /mnt is not a directory mount.nfs: mount point /mnt/testfile is not a directory This patch lets mount.nfs print more useful message, mount.nfs: mount spec 127.0.0.1:/root/testfile or point /mnt is not a directory mount.nfs: mount point /mnt/testfile is not a directory Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r--utils/mount/error.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/utils/mount/error.c b/utils/mount/error.c
index f8fc13f..e06f598 100644
--- a/utils/mount/error.c
+++ b/utils/mount/error.c
@@ -215,8 +215,12 @@ void mount_error(const char *spec, const char *mount_point, int error)
progname);
break;
case ENOTDIR:
- nfs_error(_("%s: mount point %s is not a directory"),
- progname, mount_point);
+ if (spec)
+ nfs_error(_("%s: mount spec %s or point %s is not a "
+ "directory"), progname, spec, mount_point);
+ else
+ nfs_error(_("%s: mount point %s is not a directory"),
+ progname, mount_point);
break;
case EBUSY:
nfs_error(_("%s: %s is busy or already mounted"),