]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
The text-based mount command displays the rather inexplicable "mount:
authorChuck Lever <chuck.lever@oracle.com>
Tue, 15 Jul 2008 15:59:03 +0000 (11:59 -0400)
committerSteve Dickson <steved@redhat.com>
Tue, 15 Jul 2008 15:59:03 +0000 (11:59 -0400)
internal error" whenever it encounters a problem that is entirely
unexpected by its designers.

Let's beef that error message up to include instructions about reporting
the problem, and fix the error code returned by the mount option rewriting
logic so that also will no longer report "internal error".  An error in there
should generally only occur if there was an invalid mount option specified.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
utils/mount/error.c
utils/mount/stropts.c

index 147e919bd56fdd29649ed205f7233ba66e6681b4..5fd57057705ad69f62a1c9fdb9719097f5485aa5 100644 (file)
@@ -231,8 +231,13 @@ void mount_error(const char *spec, const char *mount_point, int error)
                rpc_mount_errors((char *)spec, 0, 0);
                break;
        case EIO:
+               nfs_error(_("%s: mount system call failed"), progname);
+               break;
        case EFAULT:
-               nfs_error(_("%s: internal error"), progname);
+               nfs_error(_("%s: encountered unexpected error condition."),
+                               progname);
+               nfs_error(_("%s: please report the error to" PACKAGE_BUGREPORT),
+                               progname);
                break;
        default:
                nfs_error(_("%s: %s"),
index 967fd69531f7a338b13fe7b7775ea3d991bf2af2..c8148c42a4ed7b1a6ba42c05aaf1fe0f585b390c 100644 (file)
@@ -356,12 +356,13 @@ static struct mount_options *rewrite_mount_options(char *str)
        clnt_addr_t nfs_server = { };
        int p;
 
-       errno = EIO;
-
        options = po_split(str);
-       if (!options)
+       if (!options) {
+               errno = EFAULT;
                return NULL;
+       }
 
+       errno = EINVAL;
        option = po_get(options, "addr");
        if (option) {
                nfs_server.saddr.sin_family = AF_INET;