Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Upgrade uv to 936795a2c

  • Loading branch information...
isaacs committed May 4, 2012
1 parent ab60efb commit 719cd461d39d01ab0d2a4a396813c59daf2ad7f1
Showing with 28 additions and 2 deletions.
  1. +3 −1 deps/uv/include/uv.h
  2. +2 −0 deps/uv/src/unix/error.c
  3. +17 −0 deps/uv/src/win/error.c
  4. +6 −1 deps/uv/test/test-spawn.c
@@ -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,
@@ -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;
}
@@ -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;
}
}
@@ -25,6 +25,11 @@
#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);

0 comments on commit 719cd46

Please sign in to comment.
You can’t perform that action at this time.