From: Richard Yao Date: Tue, 3 Apr 2012 00:44:42 +0000 (-0400) Subject: Print human readable error message for ENOENT X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=commitdiff_plain;h=847de12271af349bba07027dbcbc83aaa53b4b1a;p=zfs.git 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 --- 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);