]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-windows-rmdir-not-empty-error-code-20070215
authorJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 15 Feb 2007 06:00:32 +0000 (06:00 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 15 Feb 2007 06:00:32 +0000 (06:00 +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 8d730149e946c241455ab0ec8c740addbf60b6db..d60e403c0369adf7873ab1c4770370a5b9fe1d01 100644 (file)
@@ -288,6 +288,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) 
@@ -308,24 +310,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)