if (error < 0)
error = CM_ERROR_TIMEDOUT;
- else if (error == 30)
+ else if (error == EROFS)
error = CM_ERROR_READONLY;
- else if (error == 13)
+ else if (error == EACCES)
error = CM_ERROR_NOACCESS;
- else if (error == 18)
+ else if (error == EXDEV)
error = CM_ERROR_CROSSDEVLINK;
- else if (error == 17)
+ else if (error == EEXIST)
error = CM_ERROR_EXISTS;
- else if (error == 20)
+ else if (error == ENOTDIR)
error = CM_ERROR_NOTDIR;
- else if (error == 2) /* ENOENT */
+ else if (error == ENOENT)
error = CM_ERROR_NOSUCHFILE;
- else if (error == 11 /* EAGAIN, most servers */
+ else if (error == EAGAIN
|| error == 35 /* EAGAIN, Digital UNIX */
|| error == WSAEWOULDBLOCK)
error = CM_ERROR_WOULDBLOCK;
else if (error == VDISKFULL
- || error == 28) /* ENOSPC */
+ || error == ENOSPC)
error = CM_ERROR_SPACE;
else if (error == VOVERQUOTA
+ || error == EDQUOT
|| error == 49 /* EDQUOT on Solaris */
|| error == 88 /* EDQUOT on AIX */
|| error == 69 /* EDQUOT on Digital UNIX and HPUX */
error = CM_ERROR_QUOTA;
else if (error == VNOVNODE)
error = CM_ERROR_BADFD;
- else if (error == 21)
+ else if (error == EISDIR)
return CM_ERROR_ISDIR;
return error;
}
if (error < 0)
error = CM_ERROR_TIMEDOUT;
- else if (error == 30)
+ else if (error == EROFS)
error = CM_ERROR_READONLY;
- else if (error == 20)
+ else if (error == ENOTDIR)
error = CM_ERROR_NOTDIR;
- else if (error == 13)
+ else if (error == EACCES)
error = CM_ERROR_NOACCESS;
- else if (error == 2)
+ else if (error == ENOENT)
error = CM_ERROR_NOSUCHFILE;
- else if (error == 17 /* AIX */
+ else if (error == ENOTEMPTY
+ || error == 17 /* AIX */
|| error == 66 /* SunOS 4, Digital UNIX */
|| error == 93 /* Solaris 2, IRIX */
|| error == 247) /* HP/UX */
/* Define additional local codes beyond NT errno range. */
-#define AFS_NT_ERRNO_BASE 100
-
/* Overloaded codes. */
#ifndef EWOULDBLOCK
-#define EWOULDBLOCK EAGAIN
+#define EWOULDBLOCK WSAEWOULDBLOCK
#endif
+#define ETIMEDOUT WSAETIMEDOUT
+#define EDQUOT WSAEDQUOT
+#define ELOOP WSAELOOP
+#define EOPNOTSUPP WSAEOPNOTSUPP
+#define ENOTSOCK WSAENOTSOCK
+#define ECONNREFUSED WSAECONNREFUSED
+#define ESTALE WSAESTALE
+
+
/* New codes */
-#define ELOOP (AFS_NT_ERRNO_BASE + 1)
-#define EOPNOTSUPP (AFS_NT_ERRNO_BASE + 2)
-#define EDQUOT (AFS_NT_ERRNO_BASE + 3)
-#define ENOTSOCK (AFS_NT_ERRNO_BASE + 4)
-#define ETIMEDOUT (AFS_NT_ERRNO_BASE + 5)
-#define ECONNREFUSED (AFS_NT_ERRNO_BASE + 6)
-#define ESTALE (AFS_NT_ERRNO_BASE + 7)
-#define ENOTBLK (AFS_NT_ERRNO_BASE + 8)
-#define EOVERFLOW (AFS_NT_ERRNO_BASE + 9)
-#define ENOMSG (AFS_NT_ERRNO_BASE + 10)
-#define ETIME (AFS_NT_ERRNO_BASE + 11)
+#define AFS_NT_ERRNO_BASE WSABASEERR + 1000
+
+#define EOVERFLOW (AFS_NT_ERRNO_BASE + 0)
+#define ENOMSG (AFS_NT_ERRNO_BASE + 1)
+#define ETIME (AFS_NT_ERRNO_BASE + 2)
+#define ENOTBLK (AFS_NT_ERRNO_BASE + 3)
#endif /* OPENAFS_ERRMAP_NT_H */