diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2007-09-24 11:29:15 -0400 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2007-09-25 11:50:16 +1000 |
commit | bf3527ba9bf181ff07337b7183ad28894deb8b13 (patch) | |
tree | 7301d54fbdcacf5608a378977ce56814659a4890 /utils/mount/error.c | |
parent | 6e54f6179cb9e9d5706901a06744b8f4667c24e7 (diff) | |
download | nfs-utils-bf3527ba9bf181ff07337b7183ad28894deb8b13.tar.gz nfs-utils-bf3527ba9bf181ff07337b7183ad28894deb8b13.tar.xz nfs-utils-bf3527ba9bf181ff07337b7183ad28894deb8b13.zip |
mount.nfs: Add error messages for errors reported by text-based mount(2)
The text-based mount(2) system call API can return some additional errors
that we would like to report correctly to our users. These should be safe
to use with the legacy mount(2) ABI as well.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'utils/mount/error.c')
-rw-r--r-- | utils/mount/error.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/utils/mount/error.c b/utils/mount/error.c index 480c944..10d4ed2 100644 --- a/utils/mount/error.c +++ b/utils/mount/error.c @@ -185,7 +185,7 @@ void sys_mount_errors(char *server, int error, int will_retry, int bg) fprintf(stderr, "%s\n", errbuf); } -/* +/** * mount_error - report a foreground mount error * @spec: C string containing the device name being mounted * @mount_point: C string containing the pathname of the local mounted on dir @@ -195,12 +195,24 @@ void sys_mount_errors(char *server, int error, int will_retry, int bg) void mount_error(const char *spec, const char *mount_point, int error) { switch(error) { + case EACCES: + nfs_error(_("%s: access denied by server while mounting %s"), + progname, spec); + break; + case EINVAL: + nfs_error(_("%s: an incorrect mount option was specified"), progname); + break; + case EOPNOTSUPP: + nfs_error(_("%s: requested NFS version or transport" + " protocol is not supported"), + progname); + break; case ENOTDIR: nfs_error(_("%s: mount point %s is not a directory"), progname, mount_point); break; case EBUSY: - nfs_error(_("%s: %s is already mounted or busy"), + nfs_error(_("%s: %s is busy or already mounted"), progname, mount_point); break; case ENOENT: @@ -212,6 +224,10 @@ void mount_error(const char *spec, const char *mount_point, int error) nfs_error(_("%s: mount point %s does not exist"), progname, mount_point); break; + case EIO: + case EFAULT: + nfs_error(_("%s: internal error"), progname); + break; default: nfs_error(_("%s: %s"), progname, strerror(error)); |