Browse Source

uv: upgrade to 69c2ef8

v0.8.7-release
Bert Belder 13 years ago
parent
commit
80ab9a891a
  1. 15
      deps/uv/include/uv-private/uv-win.h
  2. 10
      deps/uv/include/uv.h
  3. 20
      deps/uv/src/unix/sunos.c
  4. 1050
      deps/uv/src/win/fs.c
  5. 7
      deps/uv/src/win/process-stdio.c
  6. 9
      deps/uv/src/win/winapi.h
  7. 2
      deps/uv/test/test-tcp-unexpected-read.c

15
deps/uv/include/uv-private/uv-win.h

@ -23,6 +23,12 @@
# define _WIN32_WINNT 0x0502
#endif
#if !defined(_SSIZE_T_) && !defined(_SSIZE_T_DEFINED)
typedef intptr_t ssize_t;
# define _SSIZE_T_
# define _SSIZE_T_DEFINED
#endif
#include <process.h>
#include <stdint.h>
#include <winsock2.h>
@ -470,15 +476,16 @@ RB_HEAD(uv_timer_tree_s, uv_timer_s);
int flags; \
DWORD sys_errno_; \
union { \
wchar_t* pathw; \
int file; \
/* TODO: remove me in 0.9. */ \
WCHAR* pathw; \
int fd; \
}; \
union { \
struct { \
int mode; \
wchar_t* new_pathw; \
WCHAR* new_pathw; \
int file_flags; \
int file_out; \
int fd_out; \
void* buf; \
size_t length; \
int64_t offset; \

10
deps/uv/include/uv.h

@ -57,12 +57,6 @@ extern "C" {
#include "ares.h"
#if !defined(_SSIZE_T_) && !defined(_SSIZE_T_DEFINED)
typedef intptr_t ssize_t;
# define _SSIZE_T_
# define _SSIZE_T_DEFINED
#endif
#if defined(__unix__) || defined(__POSIX__) || defined(__APPLE__)
# include "uv-private/uv-unix.h"
#else
@ -1410,8 +1404,8 @@ struct uv_fs_s {
uv_fs_cb cb;
ssize_t result;
void* ptr;
char* path;
int errorno;
const char* path;
uv_err_code errorno;
UV_FS_PRIVATE_FIELDS
};

20
deps/uv/src/unix/sunos.c

@ -129,7 +129,7 @@ static void uv__fs_event_rearm(uv_fs_event_t *handle) {
static void uv__fs_event_read(EV_P_ ev_io* w, int revents) {
uv_fs_event_t *handle;
uv_fs_event_t *handle = NULL;
uv_loop_t *loop_;
timespec_t timeout;
port_event_t pe;
@ -139,15 +139,25 @@ static void uv__fs_event_read(EV_P_ ev_io* w, int revents) {
loop_ = container_of(w, uv_loop_t, fs_event_watcher);
do {
/* TODO use port_getn() */
uint_t n = 1;
/*
* Note that our use of port_getn() here (and not port_get()) is deliberate:
* there is a bug in event ports (Sun bug 6456558) whereby a zeroed timeout
* causes port_get() to return success instead of ETIME when there aren't
* actually any events (!); by using port_getn() in lieu of port_get(),
* we can at least workaround the bug by checking for zero returned events
* and treating it as we would ETIME.
*/
do {
memset(&timeout, 0, sizeof timeout);
r = port_get(loop_->fs_fd, &pe, &timeout);
r = port_getn(loop_->fs_fd, &pe, 1, &n, &timeout);
}
while (r == -1 && errno == EINTR);
if (r == -1 && errno == ETIME)
if ((r == -1 && errno == ETIME) || n == 0)
break;
handle = (uv_fs_event_t *)pe.portev_user;
assert((r == 0) && "unexpected port_get() error");
@ -162,7 +172,7 @@ static void uv__fs_event_read(EV_P_ ev_io* w, int revents) {
}
while (handle->fd != PORT_DELETED);
if (handle->fd != PORT_DELETED)
if (handle != NULL && handle->fd != PORT_DELETED)
uv__fs_event_rearm(handle);
}

1050
deps/uv/src/win/fs.c

File diff suppressed because it is too large

7
deps/uv/src/win/process-stdio.c

@ -330,6 +330,13 @@ int uv__stdio_create(uv_loop_t* loop, uv_process_options_t* options,
/* Make an inheritable duplicate of the handle. */
if (uv__duplicate_fd(loop, fdopt.data.fd, &child_handle) < 0) {
/* If fdopt.data.fd is not valid and fd fd <= 2, then ignore the */
/* error. */
if (fdopt.data.fd <= 2 && loop->last_err.code == UV_EBADF) {
CHILD_STDIO_CRT_FLAGS(buffer, i) = 0;
CHILD_STDIO_HANDLE(buffer, i) = NULL;
break;
}
goto error;
}

9
deps/uv/src/win/winapi.h

@ -4132,6 +4132,10 @@ typedef struct _FILE_BASIC_INFORMATION {
DWORD FileAttributes;
} FILE_BASIC_INFORMATION, *PFILE_BASIC_INFORMATION;
typedef struct _FILE_DISPOSITION_INFORMATION {
BOOLEAN DeleteFile;
} FILE_DISPOSITION_INFORMATION, *PFILE_DISPOSITION_INFORMATION;
typedef struct _FILE_MODE_INFORMATION {
ULONG Mode;
} FILE_MODE_INFORMATION, *PFILE_MODE_INFORMATION;
@ -4375,6 +4379,11 @@ typedef NTSTATUS (NTAPI *sNtQuerySystemInformation)
# define ENABLE_EXTENDED_FLAGS 0x80
#endif
/* from winerror.h */
#ifndef ERROR_SYMLINK_NOT_SUPPORTED
# define ERROR_SYMLINK_NOT_SUPPORTED 1464
#endif
typedef BOOL (WINAPI *sGetQueuedCompletionStatusEx)
(HANDLE CompletionPort,
LPOVERLAPPED_ENTRY lpCompletionPortEntries,

2
deps/uv/test/test-tcp-unexpected-read.c

@ -49,6 +49,8 @@ static void timer_cb(uv_timer_t* handle, int status) {
static uv_buf_t alloc_cb(uv_handle_t* handle, size_t suggested_size) {
ASSERT(0 && "alloc_cb should not have been called");
/* Satisfy the compiler. */
return uv_buf_init(NULL, 0);
}

Loading…
Cancel
Save