From 847de12271af349bba07027dbcbc83aaa53b4b1a Mon Sep 17 00:00:00 2001 From: Richard Yao Date: Mon, 2 Apr 2012 20:44:42 -0400 Subject: [PATCH] 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 Closes #633 --- cmd/mount_zfs/mount_zfs.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/mount_zfs/mount_zfs.c b/cmd/mount_zfs/mount_zfs.c index 6a2e9ff..1a8c98c 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); -- 1.8.3.1