aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorRichard Yao <[email protected]>2012-04-02 20:44:42 -0400
committerBrian Behlendorf <[email protected]>2012-04-03 10:24:34 -0700
commit847de12271af349bba07027dbcbc83aaa53b4b1a (patch)
tree8c41f6c5eeb952f5fb9a4bd905d692d6d416fb74 /cmd
parentfc41c6402b46d928dcc0a07435da1716b3a33c7c (diff)
Print human readable error message for ENOENT
A cryptic error code is printed when mounting a legacy dataset to a non-existent mountpoint. This patch changes this behavior to print "mount point '%s' does not exist", which is similar to the error message printed when mounting procfs. The single quotes were added to be consistent with the existing EBUSY error message, which is the only difference between this error message and the one that is printed when the same condition occurs when mounting procfs. Signed-off-by: Brian Behlendorf <[email protected]> Closes #633
Diffstat (limited to 'cmd')
-rw-r--r--cmd/mount_zfs/mount_zfs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/cmd/mount_zfs/mount_zfs.c b/cmd/mount_zfs/mount_zfs.c
index 6a2e9ff36..1a8c98cd7 100644
--- a/cmd/mount_zfs/mount_zfs.c
+++ b/cmd/mount_zfs/mount_zfs.c
@@ -480,6 +480,10 @@ main(int argc, char **argv)
mntflags, mntopts);
if (error) {
switch (errno) {
+ case ENOENT:
+ (void) fprintf(stderr, gettext("mount point "
+ "'%s' does not exist\n"), mntpoint);
+ return (MOUNT_SYSERR);
case EBUSY:
(void) fprintf(stderr, gettext("filesystem "
"'%s' is already mounted\n"), dataset);