This commit is contained in:
Ben Noordhuis 2011-08-02 01:16:15 +02:00
Родитель 99c15e5661
Коммит e0d7c2cfa3
4 изменённых файлов: 34 добавлений и 24 удалений

25
deps/uv/src/ares/CMakeLists.txt поставляемый
Просмотреть файл

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

1
deps/uv/src/uv-unix.c поставляемый
Просмотреть файл

@ -1931,6 +1931,7 @@ int uv_pipe_bind(uv_pipe_t* handle, const char* name) {
/* Success. */ /* Success. */
handle->pipe_fname = pipe_fname; /* Is a strdup'ed copy. */ handle->pipe_fname = pipe_fname; /* Is a strdup'ed copy. */
handle->pipe_flock = pipe_flock;
handle->fd = sockfd; handle->fd = sockfd;
status = 0; 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) { if (strcmp(argv[1], "spawn_helper4") == 0) {
uv_sleep(10000); /* Never surrender, never return! */
return 1; while (1) uv_sleep(10000);
} }
return run_test(argv[1], TEST_TIMEOUT, 0); 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 on_alloc(uv_stream_t* tcp, size_t suggested_size) {
uv_buf_t buf; uv_buf_t buf;
buf.base = output + output_used; 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 */ /* Note spawn_helper1 defined in test/run-tests.c */
int r = uv_exepath(exepath, &exepath_size); int r = uv_exepath(exepath, &exepath_size);
ASSERT(r == 0); ASSERT(r == 0);
@ -95,7 +109,7 @@ static void init_process_options(char* test) {
static void timer_cb(uv_timer_t* handle, int status) { 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); uv_close((uv_handle_t*)handle, close_cb);
} }
@ -105,7 +119,7 @@ TEST_IMPL(spawn_exit_code) {
uv_init(); uv_init();
init_process_options("spawn_helper1"); init_process_options("spawn_helper1", exit_cb);
r = uv_spawn(&process, options); r = uv_spawn(&process, options);
ASSERT(r == 0); ASSERT(r == 0);
@ -126,7 +140,7 @@ TEST_IMPL(spawn_stdout) {
uv_init(); uv_init();
init_process_options("spawn_helper2"); init_process_options("spawn_helper2", exit_cb);
uv_pipe_init(&out); uv_pipe_init(&out);
options.stdout_stream = &out; options.stdout_stream = &out;
@ -159,7 +173,7 @@ int r;
uv_init(); uv_init();
init_process_options("spawn_helper3"); init_process_options("spawn_helper3", exit_cb);
uv_pipe_init(&out); uv_pipe_init(&out);
uv_pipe_init(&in); uv_pipe_init(&in);
@ -193,7 +207,7 @@ TEST_IMPL(spawn_and_kill) {
uv_init(); uv_init();
init_process_options("spawn_helper4"); init_process_options("spawn_helper4", kill_cb);
r = uv_spawn(&process, options); r = uv_spawn(&process, options);
ASSERT(r == 0); ASSERT(r == 0);
@ -201,7 +215,7 @@ TEST_IMPL(spawn_and_kill) {
r = uv_timer_init(&timer); r = uv_timer_init(&timer);
ASSERT(r == 0); ASSERT(r == 0);
r = uv_timer_start(&timer, timer_cb, 1000, 0); r = uv_timer_start(&timer, timer_cb, 500, 0);
ASSERT(r == 0); ASSERT(r == 0);
r = uv_run(); r = uv_run();