Upgrade uv to 936795a2c
authorisaacs <i@izs.me>
Fri, 4 May 2012 18:00:39 +0000 (11:00 -0700)
committerisaacs <i@izs.me>
Fri, 4 May 2012 18:00:39 +0000 (11:00 -0700)
deps/uv/include/uv.h
deps/uv/src/unix/error.c
deps/uv/src/win/error.c
deps/uv/test/test-spawn.c

index c6f15e8..340ab11 100644 (file)
@@ -121,7 +121,9 @@ typedef intptr_t ssize_t;
   XX( 51, ELOOP, "too many symbolic links encountered") \
   XX( 52, EXDEV, "cross-device link not permitted") \
   XX( 53, ENOTEMPTY, "directory not empty") \
-  XX( 54, ENOSPC, "no space left on device")
+  XX( 54, ENOSPC, "no space left on device") \
+  XX( 55, EIO, "i/o error") \
+  XX( 56, EROFS, "read-only file system" )
 
 
 #define UV_ERRNO_GEN(val, name, s) UV_##name = val,
index e01d06a..62f1f14 100644 (file)
@@ -59,6 +59,7 @@ void uv_fatal_error(const int errorno, const char* syscall) {
 uv_err_code uv_translate_sys_error(int sys_errno) {
   switch (sys_errno) {
     case 0: return UV_OK;
+    case EIO: return UV_EIO;
     case EPERM: return UV_EPERM;
     case ENOSYS: return UV_ENOSYS;
     case ENOTSOCK: return UV_ENOTSOCK;
@@ -94,6 +95,7 @@ uv_err_code uv_translate_sys_error(int sys_errno) {
     case EBUSY: return UV_EBUSY;
     case ENOTEMPTY: return UV_ENOTEMPTY;
     case ENOSPC: return UV_ENOSPC;
+    case EROFS: return UV_EROFS;
     case ENOMEM: return UV_ENOMEM;
     default: return UV_UNKNOWN;
   }
index e818fc5..2940412 100644 (file)
@@ -67,6 +67,21 @@ void uv_fatal_error(const int errorno, const char* syscall) {
 uv_err_code uv_translate_sys_error(int sys_errno) {
   switch (sys_errno) {
     case ERROR_SUCCESS:                     return UV_OK;
+    case ERROR_BEGINNING_OF_MEDIA:          return UV_EIO;
+    case ERROR_BUS_RESET:                   return UV_EIO;
+    case ERROR_CRC:                         return UV_EIO;
+    case ERROR_DEVICE_DOOR_OPEN:            return UV_EIO;
+    case ERROR_DEVICE_REQUIRES_CLEANING:    return UV_EIO;
+    case ERROR_DISK_CORRUPT:                return UV_EIO;
+    case ERROR_EOM_OVERFLOW:                return UV_EIO;
+    case ERROR_FILEMARK_DETECTED:           return UV_EIO;
+    case ERROR_INVALID_BLOCK_LENGTH:        return UV_EIO;
+    case ERROR_IO_DEVICE:                   return UV_EIO;
+    case ERROR_NO_DATA_DETECTED:            return UV_EIO;
+    case ERROR_NO_SIGNAL_SENT:              return UV_EIO;
+    case ERROR_OPEN_FAILED:                 return UV_EIO;
+    case ERROR_SETMARK_DETECTED:            return UV_EIO;
+    case ERROR_SIGNAL_REFUSED:              return UV_EIO;
     case ERROR_FILE_NOT_FOUND:              return UV_ENOENT;
     case ERROR_INVALID_NAME:                return UV_ENOENT;
     case ERROR_MOD_NOT_FOUND:               return UV_ENOENT;
@@ -111,6 +126,7 @@ uv_err_code uv_translate_sys_error(int sys_errno) {
     case ERROR_EA_TABLE_FULL:               return UV_ENOSPC;
     case ERROR_END_OF_MEDIA:                return UV_ENOSPC;
     case ERROR_HANDLE_DISK_FULL:            return UV_ENOSPC;
+    case ERROR_WRITE_PROTECT:               return UV_EROFS;
     case ERROR_NOT_CONNECTED:               return UV_ENOTCONN;
     case WSAENOTCONN:                       return UV_ENOTCONN;
     case ERROR_DIR_NOT_EMPTY:               return UV_ENOTEMPTY;
@@ -128,6 +144,7 @@ uv_err_code uv_translate_sys_error(int sys_errno) {
     case WSAETIMEDOUT:                      return UV_ETIMEDOUT;
     case WSAHOST_NOT_FOUND:                 return UV_ENOENT;
     case WSAENOTSOCK:                       return UV_ENOTSOCK;
+    case ERROR_NOT_SAME_DEVICE:             return UV_EXDEV;
     default:                                return UV_UNKNOWN;
   }
 }
index c79602a..6c29fa7 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 
+#ifndef _WIN32
+#include <unistd.h>
+#endif
+
+
 static int close_cb_called;
 static int exit_cb_called;
 static uv_process_t process;
@@ -513,7 +518,7 @@ TEST_IMPL(spawn_setuid_setgid) {
 
   init_process_options2("spawn_helper1", exit_cb);
 
-  // become the "nobody" user.
+  /* become the "nobody" user. */
   struct passwd* pw;
   pw = getpwnam("nobody");
   ASSERT(pw != NULL);