diff --git a/src/unix/stream.c b/src/unix/stream.c index 2143cd88..d0c2f1ad 100644 --- a/src/unix/stream.c +++ b/src/unix/stream.c @@ -291,7 +291,10 @@ int uv__stream_try_select(uv_stream_t* stream, int* fd) { timeout.tv_sec = 0; timeout.tv_nsec = 1; - ret = kevent(kq, filter, 1, events, 1, &timeout); + do + ret = kevent(kq, filter, 1, events, 1, &timeout); + while (ret == -1 && errno == EINTR); + uv__close(kq); if (ret == -1) diff --git a/src/win/fs-event.c b/src/win/fs-event.c index f96a7bfd..03e4adc0 100644 --- a/src/win/fs-event.c +++ b/src/win/fs-event.c @@ -425,7 +425,7 @@ void uv_process_fs_event_req(uv_loop_t* loop, uv_req_t* req, } _snwprintf(filenamew, size, L"%s\\%.*s", handle->dirw, - file_info->FileNameLength / sizeof(WCHAR), + file_info->FileNameLength / (DWORD)sizeof(WCHAR), file_info->FileName); filenamew[size - 1] = L'\0'; diff --git a/src/win/util.c b/src/win/util.c index 6301b90c..a5850a97 100644 --- a/src/win/util.c +++ b/src/win/util.c @@ -54,6 +54,10 @@ /* The number of nanoseconds in one second. */ #define UV__NANOSEC 1000000000 +/* Max user name length, from iphlpapi.h */ +#ifndef UNLEN +# define UNLEN 256 +#endif /* Cached copy of the process title, plus a mutex guarding it. */ static char *process_title; diff --git a/test/test-pipe-getsockname.c b/test/test-pipe-getsockname.c index 58041c02..e42931ea 100644 --- a/test/test-pipe-getsockname.c +++ b/test/test-pipe-getsockname.c @@ -231,7 +231,7 @@ TEST_IMPL(pipe_getsockname_blocking) { len1 = sizeof buf1; r = uv_pipe_getsockname(&pipe_client, buf1, &len1); ASSERT(r == 0); - ASSERT(buf1[len1 - 1] != 0); + ASSERT(len1 == 0); /* It's an annonymous pipe. */ r = uv_read_start((uv_stream_t*)&pipe_client, NULL, NULL); ASSERT(r == 0); @@ -240,7 +240,7 @@ TEST_IMPL(pipe_getsockname_blocking) { len2 = sizeof buf2; r = uv_pipe_getsockname(&pipe_client, buf2, &len2); ASSERT(r == 0); - ASSERT(buf2[len2 - 1] != 0); + ASSERT(len2 == 0); /* It's an annonymous pipe. */ r = uv_read_stop((uv_stream_t*)&pipe_client); ASSERT(r == 0);