Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Upgrade uv to 936795a2c
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed May 4, 2012
1 parent ab60efb commit 719cd46
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
4 changes: 3 additions & 1 deletion deps/uv/include/uv.h
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions deps/uv/src/unix/error.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down
17 changes: 17 additions & 0 deletions deps/uv/src/win/error.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
}
}
Expand Down
7 changes: 6 additions & 1 deletion deps/uv/test/test-spawn.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 719cd46

Please sign in to comment.