Browse Source

Upgrade libuv to 404d697

v0.7.4-release
Ben Noordhuis 14 years ago
parent
commit
e0d7c2cfa3
  1. 25
      deps/uv/src/ares/CMakeLists.txt
  2. 1
      deps/uv/src/uv-unix.c
  3. 4
      deps/uv/test/run-tests.c
  4. 28
      deps/uv/test/test-spawn.c

25
deps/uv/src/ares/CMakeLists.txt

@ -1,27 +1,22 @@
cmake_minimum_required(VERSION 2.6)
project(ares)
string(TOLOWER ${CMAKE_SYSTEM_NAME} ares_platform)
include_directories(config_${ares_platform})
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${node_platform}-${cares_arch})
add_definitions(-DHAVE_CONFIG_H=1)
include(CheckLibraryExists)
check_library_exists(socket socket "" HAVE_SOCKET_LIB)
check_library_exists(nsl gethostbyname "" HAVE_NSL_LIB)
file(GLOB ares_source *.c)
add_library(ares ${ares_source})
file(GLOB lib_sources *.c)
add_library(cares ${lib_sources})
if(HAVE_SOCKET_LIB)
set(ares_libs ${ares_libs} socket)
if(${HAVE_SOCKET_LIB})
set(cares_libs ${cares_libs} socket)
endif()
if(HAVE_NSL_LIB)
set(ares_libs ${ares_libs} nsl)
if(${HAVE_NSL_LIB})
set(cares_libs ${cares_libs} nsl)
endif()
if(ares_libs)
target_link_libraries(ares ${ares_libs})
if(cares_libs)
target_link_libraries(cares ${cares_libs})
endif()

1
deps/uv/src/uv-unix.c

@ -1931,6 +1931,7 @@ int uv_pipe_bind(uv_pipe_t* handle, const char* name) {
/* Success. */
handle->pipe_fname = pipe_fname; /* Is a strdup'ed copy. */
handle->pipe_flock = pipe_flock;
handle->fd = sockfd;
status = 0;

4
deps/uv/test/run-tests.c

@ -70,8 +70,8 @@ static int maybe_run_test(int argc, char **argv) {
}
if (strcmp(argv[1], "spawn_helper4") == 0) {
uv_sleep(10000);
return 1;
/* Never surrender, never return! */
while (1) uv_sleep(10000);
}
return run_test(argv[1], TEST_TIMEOUT, 0);

28
deps/uv/test/test-spawn.c

@ -53,6 +53,20 @@ static void exit_cb(uv_process_t* process, int exit_status, int term_signal) {
}
static void kill_cb(uv_process_t* process, int exit_status, int term_signal) {
printf("exit_cb\n");
exit_cb_called++;
#ifdef _WIN32
ASSERT(exit_status == 1);
ASSERT(term_signal == 0);
#else
ASSERT(exit_status == 0);
ASSERT(term_signal == 15);
#endif
uv_close((uv_handle_t*)process, close_cb);
}
uv_buf_t on_alloc(uv_stream_t* tcp, size_t suggested_size) {
uv_buf_t buf;
buf.base = output + output_used;
@ -80,7 +94,7 @@ void write_cb(uv_write_t* req, int status) {
}
static void init_process_options(char* test) {
static void init_process_options(char* test, uv_exit_cb exit_cb) {
/* Note spawn_helper1 defined in test/run-tests.c */
int r = uv_exepath(exepath, &exepath_size);
ASSERT(r == 0);
@ -95,7 +109,7 @@ static void init_process_options(char* test) {
static void timer_cb(uv_timer_t* handle, int status) {
uv_process_kill(&process, 0);
uv_process_kill(&process, /* SIGTERM */ 15);
uv_close((uv_handle_t*)handle, close_cb);
}
@ -105,7 +119,7 @@ TEST_IMPL(spawn_exit_code) {
uv_init();
init_process_options("spawn_helper1");
init_process_options("spawn_helper1", exit_cb);
r = uv_spawn(&process, options);
ASSERT(r == 0);
@ -126,7 +140,7 @@ TEST_IMPL(spawn_stdout) {
uv_init();
init_process_options("spawn_helper2");
init_process_options("spawn_helper2", exit_cb);
uv_pipe_init(&out);
options.stdout_stream = &out;
@ -159,7 +173,7 @@ int r;
uv_init();
init_process_options("spawn_helper3");
init_process_options("spawn_helper3", exit_cb);
uv_pipe_init(&out);
uv_pipe_init(&in);
@ -193,7 +207,7 @@ TEST_IMPL(spawn_and_kill) {
uv_init();
init_process_options("spawn_helper4");
init_process_options("spawn_helper4", kill_cb);
r = uv_spawn(&process, options);
ASSERT(r == 0);
@ -201,7 +215,7 @@ TEST_IMPL(spawn_and_kill) {
r = uv_timer_init(&timer);
ASSERT(r == 0);
r = uv_timer_start(&timer, timer_cb, 1000, 0);
r = uv_timer_start(&timer, timer_cb, 500, 0);
ASSERT(r == 0);
r = uv_run();

Loading…
Cancel
Save