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 <behlendorf1@llnl.gov>
Closes #633
This commit is contained in:
Richard Yao 2012-04-02 20:44:42 -04:00 committed by Brian Behlendorf
parent fc41c6402b
commit 847de12271
1 changed files with 4 additions and 0 deletions

View File

@ -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);