]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
DEVEL15-windows-rmdir-not-empty-error-code-20070215
authorJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 15 Feb 2007 06:02:03 +0000 (06:02 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 15 Feb 2007 06:02:03 +0000 (06:02 +0000)
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

index 62a2b0a98689b8835e15b14b17d24911b5237dc7..66bbf65f3c0e09eb6682fa7c9eaa877daac6c2a9 100644 (file)
@@ -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)