commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r808887 - in /commons/sandbox/runtime/trunk/src/main/native: include/acr_error.h shared/error.c
Date Fri, 28 Aug 2009 13:36:35 GMT
Author: mturk
Date: Fri Aug 28 13:36:34 2009
New Revision: 808887

URL: http://svn.apache.org/viewvc?rev=808887&view=rev
Log:
Add Win32 posix<->os error mapping table

Modified:
    commons/sandbox/runtime/trunk/src/main/native/include/acr_error.h
    commons/sandbox/runtime/trunk/src/main/native/shared/error.c

Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr_error.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr_error.h?rev=808887&r1=808886&r2=808887&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/acr_error.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/acr_error.h Fri Aug 28 13:36:34
2009
@@ -817,55 +817,55 @@
 /* ACR CANONICAL ERROR VALUES */
 /** Operation not permitted */
 #ifndef EPERM
-#define ACR_EPERM                   (ACR_OS_START_CANONERR +  1)
+#define ACR_EPERM               (ACR_OS_START_CANONERR +  1)
 #else
 #define ACR_EPERM EPERM
 #endif
 /** No such file or directory */
 #ifndef ENOENT
-#define ACR_ENOENT                  (ACR_OS_START_CANONERR +  2)
+#define ACR_ENOENT              (ACR_OS_START_CANONERR +  2)
 #else
 #define ACR_ENOENT ENOENT
 #endif
 /** No such process */
 #ifndef ESRCH
-#define ACR_ESRCH                   (ACR_OS_START_CANONERR + 3)
+#define ACR_ESRCH               (ACR_OS_START_CANONERR +  3)
 #else
 #define ACR_ESRCH ESRCH
 #endif
 /** Interrupted system call */
 #ifndef EINTR
-#define ACR_EINTR                   (ACR_OS_START_CANONERR + 4)
+#define ACR_EINTR               (ACR_OS_START_CANONERR +  4)
 #else
 #define ACR_EINTR EINTR
 #endif
 /** Input/output error */
 #ifndef EIO
-#define ACR_EIO                     (ACR_OS_START_CANONERR + 5)
+#define ACR_EIO                 (ACR_OS_START_CANONERR +  5)
 #else
 #define ACR_EIO EIO
 #endif
 /** Device not configured */
 #ifndef ENXIO
-#define ACR_ENXIO                   (ACR_OS_START_CANONERR + 6)
+#define ACR_ENXIO               (ACR_OS_START_CANONERR +  6)
 #else
 #define ACR_ENXIO ENXIO
 #endif
 /** Argument list too long */
 #ifndef E2BIG
-#define ACR_E2BIG                   (ACR_OS_START_CANONERR + 7)
+#define ACR_E2BIG               (ACR_OS_START_CANONERR +  7)
 #else
 #define ACR_E2BIG E2BIG
 #endif
 /** Exec format error */
 #ifndef ENOEXEC
-#define ACR_ENOEXEC             (ACR_OS_START_CANONERR + 8)
+#define ACR_ENOEXEC             (ACR_OS_START_CANONERR +  8)
 #else
 #define ACR_ENOEXEC ENOEXEC
 #endif
 /** Bad file descriptor */
 #ifndef EBADF
-#define ACR_EBADF               (ACR_OS_START_CANONERR + 9)
+#define ACR_EBADF               (ACR_OS_START_CANONERR +  9)
 #else
 #define ACR_EBADF EBADF
 #endif

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/error.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/error.c?rev=808887&r1=808886&r2=808887&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/error.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/error.c Fri Aug 28 13:36:34 2009
@@ -454,6 +454,19 @@
     0,                  NULL
 };
 
+static const struct {
+    DWORD   get_last_error; /* Error returned from GetLastError() */
+    int     posix_error;    /* POSIX error code                   */
+} pxErrorList[] = {
+    { ERROR_INVALID_FUNCTION,                   ACR_EINVAL          },
+    { ERROR_FILE_NOT_FOUND,                     ACR_ENOENT          },
+    { ERROR_PATH_NOT_FOUND,                     ACR_ENOENT          },
+    { ERROR_TOO_MANY_OPEN_FILES,                ACR_EMFILE          },
+    { ERROR_ACCESS_DENIED,                      ACR_EACCES          },
+    { ERROR_INVALID_HANDLE,                     ACR_EBADF           },
+
+    { 0,                                        -1                  }
+};
 
 static char *acr_os_strerror(char *buf, acr_size_t bufsize, int errcode)
 {



Mime
View raw message