Showing with 9 additions and 30 deletions.
  1. +2 −2 src/inet.c
  2. +0 −2 src/unix/aix.c
  3. +0 −3 src/unix/cygwin.c
  4. +5 −6 src/win/core.c
  5. +1 −9 src/win/poll.c
  6. +1 −2 src/win/udp.c
  7. +0 −6 src/win/winsock.c
@@ -54,14 +54,14 @@ uv_err_t uv_inet_ntop(int af, const void* src, char* dst, size_t size) {
static uv_err_t inet_ntop4(const unsigned char *src, char *dst, size_t size) {
static const char fmt[] = "%u.%u.%u.%u";
char tmp[sizeof "255.255.255.255"];
size_t l;
int l;

#ifndef _WIN32
l = snprintf(tmp, sizeof(tmp), fmt, src[0], src[1], src[2], src[3]);
#else
l = _snprintf(tmp, sizeof(tmp), fmt, src[0], src[1], src[2], src[3]);
#endif
if (l <= 0 || l >= size) {
if (l <= 0 || (size_t) l >= size) {
return uv_enospc_;
}
strncpy(dst, tmp, size);
@@ -62,7 +62,6 @@ uint64_t uv__hrtime(void) {
int uv_exepath(char* buffer, size_t* size) {
ssize_t res;
char pp[64], cwdl[PATH_MAX];
size_t cwdl_len;
struct psinfo ps;
int fd;

@@ -79,7 +78,6 @@ int uv_exepath(char* buffer, size_t* size) {
return res;

cwdl[res] = '\0';
cwdl_len = res;

(void) snprintf(pp, sizeof(pp), "/proc/%lu/psinfo", (unsigned long) getpid());
fd = open(pp, O_RDONLY);
@@ -56,9 +56,6 @@ void uv_loadavg(double avg[3]) {

int uv_exepath(char* buffer, size_t* size) {
uint32_t usize;
int result;
char* path;
char* fullpath;

if (!buffer || !size) {
return -1;
@@ -185,7 +185,6 @@ int uv_backend_timeout(const uv_loop_t* loop) {


static void uv_poll(uv_loop_t* loop, int block) {
BOOL success;
DWORD bytes, timeout;
ULONG_PTR key;
OVERLAPPED* overlapped;
@@ -197,11 +196,11 @@ static void uv_poll(uv_loop_t* loop, int block) {
timeout = 0;
}

success = GetQueuedCompletionStatus(loop->iocp,
&bytes,
&key,
&overlapped,
timeout);
GetQueuedCompletionStatus(loop->iocp,
&bytes,
&key,
&overlapped,
timeout);

if (overlapped) {
/* Package was dequeued */
@@ -311,22 +311,14 @@ static SOCKET uv__fast_poll_get_peer_socket(uv_loop_t* loop,
static DWORD WINAPI uv__slow_poll_thread_proc(void* arg) {
uv_req_t* req = (uv_req_t*) arg;
uv_poll_t* handle = (uv_poll_t*) req->data;
unsigned char events, reported_events;
unsigned char reported_events;
int r;
uv_single_fd_set_t rfds, wfds, efds;
struct timeval timeout;

assert(handle->type == UV_POLL);
assert(req->type == UV_POLL_REQ);

if (req == &handle->poll_req_1) {
events = handle->submitted_events_1;
} else if (req == &handle->poll_req_2) {
events = handle->submitted_events_2;
} else {
assert(0);
}

if (handle->events & UV_READABLE) {
rfds.fd_count = 1;
rfds.fd_array[0] = handle->socket;
@@ -182,7 +182,7 @@ static int uv__bind(uv_udp_t* handle,
int addrsize,
unsigned int flags) {
int r;
DWORD no = 0, yes = 1;
DWORD no = 0;

if ((flags & UV_UDP_IPV6ONLY) && family != AF_INET6) {
/* UV_UDP_IPV6ONLY is supported only for IPV6 sockets */
@@ -658,7 +658,6 @@ int uv_udp_set_broadcast(uv_udp_t* handle, int value) {
int uv_udp_open(uv_udp_t* handle, uv_os_sock_t sock) {
WSAPROTOCOL_INFOW protocol_info;
int opt_len;
DWORD yes = 1;

/* Detect the address family of the socket. */
opt_len = (int) sizeof protocol_info;
@@ -79,12 +79,6 @@ static int error_means_no_support(DWORD error) {


void uv_winsock_init() {
const GUID wsaid_connectex = WSAID_CONNECTEX;
const GUID wsaid_acceptex = WSAID_ACCEPTEX;
const GUID wsaid_getacceptexsockaddrs = WSAID_GETACCEPTEXSOCKADDRS;
const GUID wsaid_disconnectex = WSAID_DISCONNECTEX;
const GUID wsaid_transmitfile = WSAID_TRANSMITFILE;

WSADATA wsa_data;
int errorno;
SOCKET dummy;