mirror of
https://github.com/nodejs/node.git
synced 2025-05-20 08:12:55 +00:00
Upgrade libuv to 2ef8f35
This commit is contained in:
parent
b20c98e427
commit
6b98a63974
1
deps/uv/.mailmap
vendored
1
deps/uv/.mailmap
vendored
@ -5,3 +5,4 @@
|
||||
<bertbelder@gmail.com> <info@2bs.nl>
|
||||
<alan@prettyrobots.com> <alan@blogometer.com>
|
||||
San-Tai Hsu <vanilla@fatpipi.com>
|
||||
Isaac Z. Schlueter <i@izs.me>
|
||||
|
3
deps/uv/AUTHORS
vendored
3
deps/uv/AUTHORS
vendored
@ -21,3 +21,6 @@ Clifford Heath <clifford.heath@gmail.com>
|
||||
Jorge Chamorro Bieling <jorge@jorgechamorro.com>
|
||||
Luis Lavena <luislavena@gmail.com>
|
||||
Matthew Sporleder <msporleder@gmail.com>
|
||||
Erick Tryzelaar <erick.tryzelaar@gmail.com>
|
||||
Isaac Z. Schlueter <i@izs.me>
|
||||
Pieter Noordhuis <pcnoordhuis@gmail.com>
|
||||
|
2
deps/uv/common.gypi
vendored
2
deps/uv/common.gypi
vendored
@ -113,7 +113,7 @@
|
||||
'cflags_cc': [ '-fno-rtti', '-fno-exceptions' ],
|
||||
'ldflags': [ '-pthread', ],
|
||||
'conditions': [
|
||||
[ 'target_arch=="ia32"', {
|
||||
[ 'host_arch != target_arch and target_arch=="ia32"', {
|
||||
'cflags': [ '-m32' ],
|
||||
'ldflags': [ '-m32' ],
|
||||
}],
|
||||
|
5
deps/uv/include/uv.h
vendored
5
deps/uv/include/uv.h
vendored
@ -600,6 +600,11 @@ struct uv_tty_s {
|
||||
UV_TTY_PRIVATE_FIELDS
|
||||
};
|
||||
|
||||
/*
|
||||
* Returns 1 if file is associated with a Console/TTY 0 otherwise.
|
||||
*/
|
||||
int uv_is_tty(uv_file file);
|
||||
|
||||
int uv_tty_init(uv_loop_t*, uv_tty_t*, uv_file fd);
|
||||
|
||||
/*
|
||||
|
12
deps/uv/src/unix/core.c
vendored
12
deps/uv/src/unix/core.c
vendored
@ -79,6 +79,7 @@ void uv_close(uv_handle_t* handle, uv_close_cb close_cb) {
|
||||
uv_pipe_cleanup((uv_pipe_t*)handle);
|
||||
/* Fall through. */
|
||||
|
||||
case UV_TTY:
|
||||
case UV_TCP:
|
||||
stream = (uv_stream_t*)handle;
|
||||
|
||||
@ -231,6 +232,7 @@ void uv__finish_close(uv_handle_t* handle) {
|
||||
|
||||
case UV_NAMED_PIPE:
|
||||
case UV_TCP:
|
||||
case UV_TTY:
|
||||
assert(!ev_is_active(&((uv_stream_t*)handle)->read_watcher));
|
||||
assert(!ev_is_active(&((uv_stream_t*)handle)->write_watcher));
|
||||
assert(((uv_stream_t*)handle)->fd == -1);
|
||||
@ -575,6 +577,8 @@ int64_t uv_timer_get_repeat(uv_timer_t* timer) {
|
||||
|
||||
static int uv_getaddrinfo_done(eio_req* req) {
|
||||
uv_getaddrinfo_t* handle = req->data;
|
||||
struct addrinfo *res = handle->res;
|
||||
handle->res = NULL;
|
||||
|
||||
uv_unref(handle->loop);
|
||||
|
||||
@ -587,10 +591,9 @@ static int uv_getaddrinfo_done(eio_req* req) {
|
||||
uv_err_new(handle->loop, handle->retcode);
|
||||
}
|
||||
|
||||
handle->cb(handle, handle->retcode, handle->res);
|
||||
handle->cb(handle, handle->retcode, res);
|
||||
|
||||
freeaddrinfo(handle->res);
|
||||
handle->res = NULL;
|
||||
freeaddrinfo(res);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -633,6 +636,9 @@ int uv_getaddrinfo(uv_loop_t* loop,
|
||||
handle->hints = malloc(sizeof(struct addrinfo));
|
||||
memcpy(&handle->hints, hints, sizeof(struct addrinfo));
|
||||
}
|
||||
else {
|
||||
handle->hints = NULL;
|
||||
}
|
||||
|
||||
/* TODO security! check lengths, check return values. */
|
||||
|
||||
|
5
deps/uv/src/unix/stream.c
vendored
5
deps/uv/src/unix/stream.c
vendored
@ -679,8 +679,9 @@ int uv_write(uv_write_t* req, uv_stream_t* stream, uv_buf_t bufs[], int bufcnt,
|
||||
uv_write_cb cb) {
|
||||
int empty_queue;
|
||||
|
||||
assert((stream->type == UV_TCP || stream->type == UV_NAMED_PIPE)
|
||||
&& "uv_write (unix) does not yet support other types of streams");
|
||||
assert((stream->type == UV_TCP || stream->type == UV_NAMED_PIPE ||
|
||||
stream->type == UV_TTY) &&
|
||||
"uv_write (unix) does not yet support other types of streams");
|
||||
|
||||
if (stream->fd < 0) {
|
||||
uv_err_new(stream->loop, EBADF);
|
||||
|
4
deps/uv/src/unix/tty.c
vendored
4
deps/uv/src/unix/tty.c
vendored
@ -67,3 +67,7 @@ fatal:
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
int uv_is_tty(uv_file file) {
|
||||
return isatty(file);
|
||||
}
|
||||
|
9
deps/uv/src/win/process.c
vendored
9
deps/uv/src/win/process.c
vendored
@ -845,14 +845,19 @@ static int duplicate_std_handle(uv_loop_t* loop, DWORD id, HANDLE* dup) {
|
||||
int uv_spawn(uv_loop_t* loop, uv_process_t* process,
|
||||
uv_process_options_t options) {
|
||||
int err = 0, keep_child_stdio_open = 0;
|
||||
wchar_t* path;
|
||||
wchar_t* path = NULL;
|
||||
int size;
|
||||
BOOL result;
|
||||
wchar_t* application_path, *application, *arguments, *env, *cwd;
|
||||
wchar_t* application_path = NULL, *application = NULL, *arguments = NULL, *env = NULL, *cwd = NULL;
|
||||
HANDLE* child_stdio = process->child_stdio;
|
||||
STARTUPINFOW startup;
|
||||
PROCESS_INFORMATION info;
|
||||
|
||||
if (!options.file) {
|
||||
uv_set_error(loop, UV_EINVAL, 0);
|
||||
return -1;
|
||||
}
|
||||
|
||||
uv_process_init(loop, process);
|
||||
|
||||
process->exit_cb = options.exit_cb;
|
||||
|
7
deps/uv/src/win/tty.c
vendored
7
deps/uv/src/win/tty.c
vendored
@ -35,3 +35,10 @@ int uv_tty_set_mode(uv_tty_t* tty, int mode) {
|
||||
assert(0 && "implement me");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
int uv_is_tty(uv_file file) {
|
||||
DWORD result;
|
||||
int r = GetConsoleMode((HANDLE)_get_osfhandle(file), &result);
|
||||
return r ? 1 : 0;
|
||||
}
|
||||
|
8
deps/uv/test/test-getaddrinfo.c
vendored
8
deps/uv/test/test-getaddrinfo.c
vendored
@ -31,10 +31,10 @@
|
||||
|
||||
static const char* name = "localhost";
|
||||
|
||||
static uv_getaddrinfo_t getaddrinfo_handle;
|
||||
static int getaddrinfo_cbs = 0;
|
||||
|
||||
/* data used for running multiple calls concurrently */
|
||||
static uv_getaddrinfo_t* getaddrinfo_handle;
|
||||
static uv_getaddrinfo_t getaddrinfo_handles[CONCURRENT_COUNT];
|
||||
static int callback_counts[CONCURRENT_COUNT];
|
||||
|
||||
@ -42,8 +42,9 @@ static int callback_counts[CONCURRENT_COUNT];
|
||||
static void getaddrinfo_basic_cb(uv_getaddrinfo_t* handle,
|
||||
int status,
|
||||
struct addrinfo* res) {
|
||||
ASSERT(handle == &getaddrinfo_handle);
|
||||
ASSERT(handle == getaddrinfo_handle);
|
||||
getaddrinfo_cbs++;
|
||||
free(handle);
|
||||
}
|
||||
|
||||
|
||||
@ -71,9 +72,10 @@ static void getaddrinfo_cuncurrent_cb(uv_getaddrinfo_t* handle,
|
||||
|
||||
TEST_IMPL(getaddrinfo_basic) {
|
||||
int r;
|
||||
getaddrinfo_handle = (uv_getaddrinfo_t*)malloc(sizeof(uv_getaddrinfo_t));
|
||||
|
||||
r = uv_getaddrinfo(uv_default_loop(),
|
||||
&getaddrinfo_handle,
|
||||
getaddrinfo_handle,
|
||||
&getaddrinfo_basic_cb,
|
||||
name,
|
||||
NULL,
|
||||
|
3
deps/uv/test/test-list.h
vendored
3
deps/uv/test/test-list.h
vendored
@ -19,6 +19,7 @@
|
||||
* IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
TEST_DECLARE (tty)
|
||||
TEST_DECLARE (tcp_ping_pong)
|
||||
TEST_DECLARE (tcp_ping_pong_v6)
|
||||
TEST_DECLARE (pipe_ping_pong)
|
||||
@ -98,6 +99,8 @@ HELPER_DECLARE (pipe_echo_server)
|
||||
|
||||
|
||||
TASK_LIST_START
|
||||
TEST_ENTRY (tty)
|
||||
|
||||
TEST_ENTRY (tcp_ping_pong)
|
||||
TEST_HELPER (tcp_ping_pong, tcp4_echo_server)
|
||||
|
||||
|
33
deps/uv/test/test-tty.c
vendored
Normal file
33
deps/uv/test/test-tty.c
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to
|
||||
* deal in the Software without restriction, including without limitation the
|
||||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
* sell copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "uv.h"
|
||||
#include "task.h"
|
||||
|
||||
TEST_IMPL(tty) {
|
||||
uv_loop_t* loop = uv_default_loop();
|
||||
|
||||
ASSERT(uv_is_tty(0) == 1);
|
||||
|
||||
uv_run(loop);
|
||||
|
||||
return 0;
|
||||
}
|
6
deps/uv/uv.gyp
vendored
6
deps/uv/uv.gyp
vendored
@ -194,7 +194,10 @@
|
||||
'include_dirs': [ 'src/ares/config_darwin' ],
|
||||
'sources': [ 'src/unix/darwin.c' ],
|
||||
'direct_dependent_settings': {
|
||||
'libraries': [ '-framework CoreServices' ],
|
||||
'libraries': [
|
||||
'$(SDKROOT)/System/Library/Frameworks/Carbon.framework',
|
||||
'$(SDKROOT)/System/Library/Frameworks/CoreServices.framework',
|
||||
],
|
||||
},
|
||||
'defines': [
|
||||
'EV_CONFIG_H="config_darwin.h"',
|
||||
@ -261,6 +264,7 @@
|
||||
'test/test-tcp-bind-error.c',
|
||||
'test/test-tcp-bind6-error.c',
|
||||
'test/test-tcp-close.c',
|
||||
'test/test-tcp-write-error.c',
|
||||
'test/test-tcp-writealot.c',
|
||||
'test/test-threadpool.c',
|
||||
'test/test-timer-again.c',
|
||||
|
Loading…
Reference in New Issue
Block a user