X-Git-Url: http://git.openafs.org/?p=openafs.git;a=blobdiff_plain;f=src%2FWINNT%2Fafsd%2Fcm_utils.c;h=314bb44f4d7696db6d59228ee3cda60c6e48baa5;hp=f7e3284c09a78ff9a74279e8af4f159050d45b37;hb=14408c7e88c198d80ce89e90e209f48685da89da;hpb=31094ffc5acc68ad8e38b22a070554ef6e456f59 diff --git a/src/WINNT/afsd/cm_utils.c b/src/WINNT/afsd/cm_utils.c index f7e3284..314bb44 100644 --- a/src/WINNT/afsd/cm_utils.c +++ b/src/WINNT/afsd/cm_utils.c @@ -30,70 +30,87 @@ cm_space_t *cm_spaceListp; long cm_MapRPCError(long error, cm_req_t *reqp) { - if (error == 0) return 0; - - /* If we had to stop retrying, report our saved error code. */ - if (reqp && error == CM_ERROR_TIMEDOUT) { - if (reqp->accessError) - return reqp->accessError; - if (reqp->volumeError) - return reqp->volumeError; - if (reqp->rpcError) - return reqp->rpcError; - return error; - } - - if (error < 0) error = CM_ERROR_TIMEDOUT; - else if (error == 30) error = CM_ERROR_READONLY; - else if (error == 13) error = CM_ERROR_NOACCESS; - else if (error == 18) error = CM_ERROR_CROSSDEVLINK; - else if (error == 17) error = CM_ERROR_EXISTS; - else if (error == 20) error = CM_ERROR_NOTDIR; - else if (error == 2) error = CM_ERROR_NOSUCHFILE; - else if (error == 11 /* EAGAIN, most servers */ - || error == 35) /* EAGAIN, Digital UNIX */ - error = CM_ERROR_WOULDBLOCK; - else if (error == VDISKFULL - || error == 28) /* ENOSPC */ - error = CM_ERROR_SPACE; - else if (error == VOVERQUOTA - || error == 49 /* EDQUOT on Solaris */ - || error == 88 /* EDQUOT on AIX */ - || error == 69 /* EDQUOT on Digital UNIX and HPUX */ - || error == 122 /* EDQUOT on Linux */ - || error == 1133) /* EDQUOT on Irix */ - error = CM_ERROR_QUOTA; - else if (error == VNOVNODE) error = CM_ERROR_BADFD; + if (error == 0) + return 0; + + /* If we had to stop retrying, report our saved error code. */ + if (reqp && error == CM_ERROR_TIMEDOUT) { + if (reqp->accessError) + return reqp->accessError; + if (reqp->volumeError) + return reqp->volumeError; + if (reqp->rpcError) + return reqp->rpcError; return error; + } + + if (error < 0) + error = CM_ERROR_TIMEDOUT; + else if (error == 30) + error = CM_ERROR_READONLY; + else if (error == 13) + error = CM_ERROR_NOACCESS; + else if (error == 18) + error = CM_ERROR_CROSSDEVLINK; + else if (error == 17) + error = CM_ERROR_EXISTS; + else if (error == 20) + error = CM_ERROR_NOTDIR; + else if (error == 2) + error = CM_ERROR_NOSUCHFILE; + else if (error == 11 /* EAGAIN, most servers */ + || error == 35) /* EAGAIN, Digital UNIX */ + error = CM_ERROR_WOULDBLOCK; + else if (error == VDISKFULL + || error == 28) /* ENOSPC */ + error = CM_ERROR_SPACE; + else if (error == VOVERQUOTA + || error == 49 /* EDQUOT on Solaris */ + || error == 88 /* EDQUOT on AIX */ + || error == 69 /* EDQUOT on Digital UNIX and HPUX */ + || error == 122 /* EDQUOT on Linux */ + || error == 1133) /* EDQUOT on Irix */ + error = CM_ERROR_QUOTA; + else if (error == VNOVNODE) + error = CM_ERROR_BADFD; + else if (error == 21) + return CM_ERROR_ISDIR; + return error; } long cm_MapRPCErrorRmdir(long error, cm_req_t *reqp) { - if (error == 0) return 0; - - /* If we had to stop retrying, report our saved error code. */ - if (reqp && error == CM_ERROR_TIMEDOUT) { - if (reqp->accessError) - return reqp->accessError; - if (reqp->volumeError) - return reqp->volumeError; - if (reqp->rpcError) - return reqp->rpcError; - return error; - } - - if (error < 0) error = CM_ERROR_TIMEDOUT; - else if (error == 30) error = CM_ERROR_READONLY; - else if (error == 20) error = CM_ERROR_NOTDIR; - else if (error == 13) error = CM_ERROR_NOACCESS; - else if (error == 2) error = CM_ERROR_NOSUCHFILE; - else if (error == 17 /* AIX */ - || error == 66 /* SunOS 4, Digital UNIX */ - || error == 93 /* Solaris 2, IRIX */ - || error == 247) /* HP/UX */ - error = CM_ERROR_NOTEMPTY; + if (error == 0) + return 0; + + /* If we had to stop retrying, report our saved error code. */ + if (reqp && error == CM_ERROR_TIMEDOUT) { + if (reqp->accessError) + return reqp->accessError; + if (reqp->volumeError) + return reqp->volumeError; + if (reqp->rpcError) + return reqp->rpcError; return error; -} + } + + if (error < 0) + error = CM_ERROR_TIMEDOUT; + else if (error == 30) + error = CM_ERROR_READONLY; + else if (error == 20) + error = CM_ERROR_NOTDIR; + else if (error == 13) + error = CM_ERROR_NOACCESS; + else if (error == 2) + error = CM_ERROR_NOSUCHFILE; + else if (error == 17 /* AIX */ + || error == 66 /* SunOS 4, Digital UNIX */ + || error == 93 /* Solaris 2, IRIX */ + || error == 247) /* HP/UX */ + error = CM_ERROR_NOTEMPTY; + return error; +} long cm_MapVLRPCError(long error, cm_req_t *reqp) { @@ -110,8 +127,10 @@ long cm_MapVLRPCError(long error, cm_req_t *reqp) return error; } - if (error < 0) error = CM_ERROR_TIMEDOUT; - else if (error == VL_NOENT) error = CM_ERROR_NOSUCHVOLUME; + if (error < 0) + error = CM_ERROR_TIMEDOUT; + else if (error == VL_NOENT) + error = CM_ERROR_NOSUCHVOLUME; return error; }