DEVEL15-windows-largefile-support-20060623
[openafs.git] / src / WINNT / afsd / cm_utils.c
index 8e90e3d..d764a65 100644 (file)
@@ -10,6 +10,7 @@
 #include <afs/param.h>
 #include <afs/stds.h>
 
+#include <errno.h>
 #ifndef DJGPP
 #include <windows.h>
 #include <winsock2.h>
 #define ETIMEDOUT               WSAETIMEDOUT
 #define ECONNREFUSED            WSAECONNREFUSED
 #define ELOOP                   WSAELOOP
+#ifdef ENAMETOOLONG
+#undef ENAMETOOLONG
+#endif
 #define ENAMETOOLONG            WSAENAMETOOLONG
 #define EHOSTDOWN               WSAEHOSTDOWN
 #define EHOSTUNREACH            WSAEHOSTUNREACH
+#ifdef ENOTEMPTY
+#undef ENOTEMPTY
+#endif 
 #define ENOTEMPTY               WSAENOTEMPTY
 #define EPROCLIM                WSAEPROCLIM
 #define EUSERS                  WSAEUSERS
 #define EREMOTE                 WSAEREMOTE
 #endif /* EWOULDBLOCK */
 #endif /* !DJGPP */
+#include <afs/unified_afs.h>
+
 #include <string.h>
 #include <malloc.h>
-
+#include "afsd.h"
 #include <osi.h>
 #include <rx/rx.h>
 
-#include <errno.h>
-#include <afs/unified_afs.h>
-
-#include "afsd.h"
 
 static osi_once_t cm_utilsOnce;
 
@@ -241,7 +246,7 @@ long cm_MapRPCError(long error, cm_req_t *reqp)
         error = CM_ERROR_EXISTS;
     else if (error == 20) 
         error = CM_ERROR_NOTDIR;
-    else if (error == 2) 
+    else if (error == 2)       /* ENOENT */
         error = CM_ERROR_NOSUCHFILE;
     else if (error == 11        /* EAGAIN, most servers */
              || error == 35)   /* EAGAIN, Digital UNIX */
@@ -256,9 +261,13 @@ long cm_MapRPCError(long error, cm_req_t *reqp)
               || error == 122   /* EDQUOT on Linux */
               || error == 1133) /* EDQUOT on Irix  */
         error = CM_ERROR_QUOTA;
-    else if (error == VNOVNODE) 
+    else if (error == VNOVNODE) {
+#ifdef COMMENT
         error = CM_ERROR_BADFD;
-    else if (error == 21)
+#else
+        error = CM_ERROR_RETRY;
+#endif
+    } else if (error == 21)
         return CM_ERROR_ISDIR;
     return error;
 }