Merge 44f49dd752 into f61f9c29d8
This commit is contained in:
commit
9add7ed668
@ -279,7 +279,7 @@ typedef struct {
|
|||||||
DWORD tls_index;
|
DWORD tls_index;
|
||||||
} uv_key_t;
|
} uv_key_t;
|
||||||
|
|
||||||
#define UV_ONCE_INIT { 0, NULL }
|
#define UV_ONCE_INIT { 0, INIT_ONCE_STATIC_INIT }
|
||||||
|
|
||||||
typedef struct uv_once_s {
|
typedef struct uv_once_s {
|
||||||
unsigned char unused;
|
unsigned char unused;
|
||||||
|
|||||||
@ -215,7 +215,8 @@ int uv__stdio_create(uv_loop_t* loop,
|
|||||||
* handles in the stdio buffer are initialized with.
|
* handles in the stdio buffer are initialized with.
|
||||||
* INVALID_HANDLE_VALUE, which should be okay. */
|
* INVALID_HANDLE_VALUE, which should be okay. */
|
||||||
if (i <= 2) {
|
if (i <= 2) {
|
||||||
HANDLE nul;
|
/* Redundantly initialize to make the compiler happy. */
|
||||||
|
HANDLE nul = INVALID_HANDLE_VALUE;
|
||||||
DWORD access = (i == 0) ? FILE_GENERIC_READ :
|
DWORD access = (i == 0) ? FILE_GENERIC_READ :
|
||||||
FILE_GENERIC_WRITE | FILE_READ_ATTRIBUTES;
|
FILE_GENERIC_WRITE | FILE_READ_ATTRIBUTES;
|
||||||
|
|
||||||
@ -223,7 +224,7 @@ int uv__stdio_create(uv_loop_t* loop,
|
|||||||
if (err)
|
if (err)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
memcpy(CHILD_STDIO_HANDLE(buffer, i), &nul, sizeof(HANDLE));
|
memcpy(CHILD_STDIO_HANDLE(buffer, i), &nul, sizeof(HANDLE));
|
||||||
CHILD_STDIO_CRT_FLAGS(buffer, i) = FOPEN | FDEV;
|
CHILD_STDIO_CRT_FLAGS(buffer, i) = FOPEN | FDEV;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -248,7 +249,7 @@ int uv__stdio_create(uv_loop_t* loop,
|
|||||||
if (err)
|
if (err)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
memcpy(CHILD_STDIO_HANDLE(buffer, i), &child_pipe, sizeof(HANDLE));
|
memcpy(CHILD_STDIO_HANDLE(buffer, i), &child_pipe, sizeof(HANDLE));
|
||||||
CHILD_STDIO_CRT_FLAGS(buffer, i) = FOPEN | FPIPE;
|
CHILD_STDIO_CRT_FLAGS(buffer, i) = FOPEN | FPIPE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -299,7 +300,7 @@ int uv__stdio_create(uv_loop_t* loop,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(CHILD_STDIO_HANDLE(buffer, i), &child_handle, sizeof(HANDLE));
|
memcpy(CHILD_STDIO_HANDLE(buffer, i), &child_handle, sizeof(HANDLE));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -335,7 +336,7 @@ int uv__stdio_create(uv_loop_t* loop,
|
|||||||
if (err)
|
if (err)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
memcpy(CHILD_STDIO_HANDLE(buffer, i), &child_handle, sizeof(HANDLE));
|
memcpy(CHILD_STDIO_HANDLE(buffer, i), &child_handle, sizeof(HANDLE));
|
||||||
CHILD_STDIO_CRT_FLAGS(buffer, i) = crt_flags;
|
CHILD_STDIO_CRT_FLAGS(buffer, i) = crt_flags;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -509,7 +509,7 @@ unsigned int uv_available_parallelism(void) {
|
|||||||
DWORD_PTR procmask;
|
DWORD_PTR procmask;
|
||||||
DWORD_PTR sysmask;
|
DWORD_PTR sysmask;
|
||||||
int count;
|
int count;
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
/* TODO(bnoordhuis) Use GetLogicalProcessorInformationEx() to support systems
|
/* TODO(bnoordhuis) Use GetLogicalProcessorInformationEx() to support systems
|
||||||
* with > 64 CPUs? See https://github.com/libuv/libuv/pull/3458
|
* with > 64 CPUs? See https://github.com/libuv/libuv/pull/3458
|
||||||
|
|||||||
@ -26,6 +26,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
static int connect_cb_called;
|
static int connect_cb_called;
|
||||||
static int write_cb_called;
|
static int write_cb_called;
|
||||||
static int close_cb_called;
|
static int close_cb_called;
|
||||||
@ -47,6 +48,7 @@ static void write_cb(uv_write_t* req, int status) {
|
|||||||
ASSERT_LT(status, 0);
|
ASSERT_LT(status, 0);
|
||||||
write_cb_called++;
|
write_cb_called++;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -22,6 +22,7 @@
|
|||||||
#include "uv.h"
|
#include "uv.h"
|
||||||
#include "task.h"
|
#include "task.h"
|
||||||
|
|
||||||
|
#if !defined(__OpenBSD__) && !defined(_WIN32)
|
||||||
static uv_tcp_t tcp;
|
static uv_tcp_t tcp;
|
||||||
static uv_connect_t connect_req;
|
static uv_connect_t connect_req;
|
||||||
static uv_buf_t qbuf;
|
static uv_buf_t qbuf;
|
||||||
@ -69,6 +70,7 @@ static void connect_cb(uv_connect_t *req, int status) {
|
|||||||
|
|
||||||
called_connect_cb++;
|
called_connect_cb++;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -26,6 +26,7 @@
|
|||||||
#include "task.h"
|
#include "task.h"
|
||||||
#include "uv.h"
|
#include "uv.h"
|
||||||
|
|
||||||
|
#if !defined(_WIN32) && !defined(__PASE__)
|
||||||
static uv_tcp_t server;
|
static uv_tcp_t server;
|
||||||
static uv_tcp_t client;
|
static uv_tcp_t client;
|
||||||
static uv_tcp_t incoming;
|
static uv_tcp_t incoming;
|
||||||
@ -110,6 +111,7 @@ static void start_server(void) {
|
|||||||
ASSERT_OK(uv_tcp_bind(&server, (struct sockaddr*) &addr, 0));
|
ASSERT_OK(uv_tcp_bind(&server, (struct sockaddr*) &addr, 0));
|
||||||
ASSERT_OK(uv_listen((uv_stream_t*) &server, 128, connection_cb));
|
ASSERT_OK(uv_listen((uv_stream_t*) &server, 128, connection_cb));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
TEST_IMPL(tcp_write_in_a_row) {
|
TEST_IMPL(tcp_write_in_a_row) {
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user