#define EDQUOT ENOSPC
#endif
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+
static struct {
enum nfsstat stat;
int errnum;
#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;
}
#ifndef _NFS_UTILS_MOUNT_ERROR_H
#define _NFS_UTILS_MOUNT_ERROR_H
-char *nfs_strerror(int);
+char *nfs_strerror(unsigned int);
void mount_error(const char *, const char *, int);
void rpc_mount_errors(char *, int, int);