From: Jeffrey Altman Date: Thu, 31 Jan 2008 07:31:56 +0000 (+0000) Subject: DEVEL15-windows-edquot-20080131 X-Git-Tag: openafs-devel-1_5_31~51 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=6e2fe4431ba7ec0a78131e7724e0202accf9896b;p=packages%2Fo%2Fopenafs.git DEVEL15-windows-edquot-20080131 LICENSE MIT For Windows, EDQUOT == WSAEDQUOT. Define it in the right places so that in the end STATUS_OUT_OF_QUOTA can be returned to the application. (cherry picked from commit 03e72233178bf18a8978d62c3bcc4ebb743e6710) --- diff --git a/src/WINNT/afsd/cm_utils.c b/src/WINNT/afsd/cm_utils.c index 1c7de6191..2bc2b4040 100644 --- a/src/WINNT/afsd/cm_utils.c +++ b/src/WINNT/afsd/cm_utils.c @@ -239,26 +239,27 @@ long cm_MapRPCError(long error, cm_req_t *reqp) 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 */ @@ -267,7 +268,7 @@ long cm_MapRPCError(long error, cm_req_t *reqp) 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; } @@ -292,15 +293,16 @@ long cm_MapRPCErrorRmdir(long error, cm_req_t *reqp) 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 */ diff --git a/src/WINNT/afsd/smb.c b/src/WINNT/afsd/smb.c index 99de7eab7..461f2c8fb 100644 --- a/src/WINNT/afsd/smb.c +++ b/src/WINNT/afsd/smb.c @@ -2826,11 +2826,7 @@ void smb_MapNTError(long code, unsigned long *NTStatusp) NTStatus = 0xC09820FBL; /* SMB use standard */ } else if (code == CM_ERROR_QUOTA) { -#ifdef COMMENT NTStatus = 0xC0000044L; /* Quota exceeded */ -#else - NTStatus = 0xC000007FL; /* Disk full */ -#endif } else if (code == CM_ERROR_SPACE) { NTStatus = 0xC000007FL; /* Disk full */ diff --git a/src/rx/rx_misc.c b/src/rx/rx_misc.c index eb8167cd3..d9b13017b 100644 --- a/src/rx/rx_misc.c +++ b/src/rx/rx_misc.c @@ -34,6 +34,11 @@ RCSID #ifdef HAVE_UNISTD_H #include #endif +#ifdef AFS_NT40_ENV +#ifndef EDQUOT +#define EDQUOT WSAEDQUOT +#endif /* EDQUOT */ +#endif /* AFS_NT40_ENV */ #endif /* @@ -54,7 +59,6 @@ hton_syserr_conv(register afs_int32 code) if (code == ENOSPC) err = VDISKFULL; #ifdef EDQUOT - /* EDQUOT doesn't exist on solaris */ else if (code == EDQUOT) err = VOVERQUOTA; #endif diff --git a/src/util/errmap_nt.h b/src/util/errmap_nt.h index c22d120cd..8c183ebcf 100644 --- a/src/util/errmap_nt.h +++ b/src/util/errmap_nt.h @@ -18,24 +18,26 @@ extern int nterr_nt2unix(long ntErr, int defaultErr); /* 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 */