]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/mount/error.c
mount: remove legacy version of nfs_name_to_address()
[nfs-utils.git] / utils / mount / error.c
index 480c944c88020b0cd14821b636c3c81b2489fb1a..5c9d3f2f69a3952131516d44fac8d6b4e202cf5a 100644 (file)
  *  + Proper support for internationalization
  */
 
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <unistd.h>
 #include <sys/types.h>
 #include <stdio.h>
@@ -32,8 +35,6 @@
 #include <fcntl.h>
 #include <syslog.h>
 #include <rpc/rpc.h>
-#include <rpc/pmap_prot.h>
-#include <rpc/pmap_clnt.h>
 
 #include "xcommon.h"
 #include "nls.h"
@@ -185,7 +186,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 +196,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 +225,18 @@ 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 ESPIPE:
+               rpc_mount_errors((char *)spec, 0, 0);
+               break;
+       case EIO:
+               nfs_error(_("%s: mount system call failed"), progname);
+               break;
+       case EFAULT:
+               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"),
                        progname, strerror(error));