From: Jeffrey Altman Date: Thu, 15 Feb 2007 05:59:14 +0000 (+0000) Subject: windows-rmdir-not-empty-error-code-20070215 X-Git-Tag: BP-openafs-windows-kdfs-ifs~787 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=1f530ff095a8ffa38114373c80d8f4c5ead103d8;p=packages%2Fo%2Fopenafs.git windows-rmdir-not-empty-error-code-20070215 Ensure that removing a directory containing existing files returns the correct error to the caller. --- diff --git a/src/WINNT/afsd/cm_utils.c b/src/WINNT/afsd/cm_utils.c index b7a747c5a..acf08b021 100644 --- a/src/WINNT/afsd/cm_utils.c +++ b/src/WINNT/afsd/cm_utils.c @@ -282,6 +282,8 @@ long cm_MapRPCErrorRmdir(long error, cm_req_t *reqp) return error; } + error = et_to_sys_error(error); + if (error < 0) error = CM_ERROR_TIMEDOUT; else if (error == 30) @@ -302,24 +304,26 @@ long cm_MapRPCErrorRmdir(long error, cm_req_t *reqp) long cm_MapVLRPCError(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) return 0; - if (error < 0) - error = CM_ERROR_TIMEDOUT; - else if (error == VL_NOENT) - error = CM_ERROR_NOSUCHVOLUME; + /* 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; + } + + error = et_to_sys_error(error); + + if (error < 0) + error = CM_ERROR_TIMEDOUT; + else if (error == VL_NOENT) + error = CM_ERROR_NOSUCHVOLUME; + return error; } cm_space_t *cm_GetSpace(void)