X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fmount%2Ferror.c;h=4cc9e0949e3645dbbd6b17c077161e3adb5ab2f5;hp=23a91ff792d719e38b22a46730009e49c303b28d;hb=906f0b27730b0506a24ed43029983b4d6819dd12;hpb=ab26cd622e1a5ef22be2df1f3176158b1505df30 diff --git a/utils/mount/error.c b/utils/mount/error.c index 23a91ff..4cc9e09 100644 --- a/utils/mount/error.c +++ b/utils/mount/error.c @@ -35,8 +35,6 @@ #include #include #include -#include -#include #include "xcommon.h" #include "nls.h" @@ -227,9 +225,17 @@ 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: 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"), @@ -294,6 +300,8 @@ void umount_error(int err, const char *dev) #define EDQUOT ENOSPC #endif +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) + static struct { enum nfsstat stat; int errnum; @@ -323,19 +331,17 @@ static struct { #endif /* Throw in some NFSv3 values for even more fun (HP returns these) */ { 71, EREMOTE }, - - { -1, EIO } }; -char *nfs_strerror(int stat) +char *nfs_strerror(unsigned int stat) { - int i; + unsigned int i; static char buf[256]; - for (i = 0; nfs_errtbl[i].stat != -1; i++) { + for (i = 0; i < ARRAY_SIZE(nfs_errtbl); i++) { if (nfs_errtbl[i].stat == stat) return strerror(nfs_errtbl[i].errnum); } - sprintf(buf, _("unknown nfs status return value: %d"), stat); + sprintf(buf, _("unknown nfs status return value: %u"), stat); return buf; }