From 44962d936f9d62c85550ad93ff018f9e40e7decd Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Thu, 15 Feb 2007 06:02:03 +0000 Subject: [PATCH] DEVEL15-windows-rmdir-not-empty-error-code-20070215 Ensure that removing a directory containing existing files returns the correct error to the caller. (cherry picked from commit 1f530ff095a8ffa38114373c80d8f4c5ead103d8) --- src/WINNT/afsd/cm_utils.c | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/src/WINNT/afsd/cm_utils.c b/src/WINNT/afsd/cm_utils.c index 62a2b0a98..66bbf65f3 100644 --- a/src/WINNT/afsd/cm_utils.c +++ b/src/WINNT/afsd/cm_utils.c @@ -284,6 +284,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) @@ -304,24 +306,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) -- 2.39.5