Skip to content

Commit ae648a4

Browse files
committed
Upgrade libuv to 9c064fb
1 parent 9b4e8e0 commit ae648a4

31 files changed

+246
-49
lines changed

deps/uv/.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ Isaac Z. Schlueter <[email protected]>
99
Saúl Ibarra Corretgé <[email protected]>
1010
Yuki OKUMURA <[email protected]>
1111
Frank Denis <[email protected]>
12+
Ryan Emery <[email protected]>

deps/uv/AUTHORS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,6 @@ Roman Shtylman <[email protected]>
3333
Frank Denis <[email protected]>
3434
Carter Allen <[email protected]>
3535
Tj Holowaychuk <[email protected]>
36+
Shimon Doodkin <[email protected]>
37+
Ryan Emery <[email protected]>
38+
Bruce Mitchener <[email protected]>

deps/uv/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# libuv
22

33
libuv is a new platform layer for Node. Its purpose is to abstract IOCP on
4-
windows and libev on Unix systems. We intend to eventually contain all
4+
Windows and libev on Unix systems. We intend to eventually contain all
55
platform differences in this library.
66

77
http://nodejs.org/

deps/uv/config-unix.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ endif
5050
ifeq (Darwin,$(uname_S))
5151
EV_CONFIG=config_darwin.h
5252
EIO_CONFIG=config_darwin.h
53-
CPPFLAGS += -D__DARWIN_64_BIT_INO_T=1
5453
CPPFLAGS += -Isrc/ares/config_darwin
5554
LINKFLAGS+=-framework CoreServices
5655
OBJS += src/unix/darwin.o

deps/uv/include/uv.h

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ typedef intptr_t ssize_t;
106106
XX( 35, ENOSYS, "function not implemented") \
107107
XX( 36, EPIPE, "broken pipe") \
108108
XX( 37, EPROTO, "protocol error") \
109-
XX( 38, EPROTONOSUPPORT, "protocol not suppored") \
109+
XX( 38, EPROTONOSUPPORT, "protocol not supported") \
110110
XX( 39, EPROTOTYPE, "protocol wrong type for socket") \
111111
XX( 40, ETIMEDOUT, "connection timed out") \
112112
XX( 41, ECHARSET, "") \
@@ -226,7 +226,6 @@ UV_EXTERN int64_t uv_now(uv_loop_t*);
226226
/*
227227
* The status parameter is 0 if the request completed successfully,
228228
* and should be -1 if the request was cancelled or failed.
229-
* For uv_close_cb, -1 means that the handle was closed due to an error.
230229
* Error details can be obtained by calling uv_last_error().
231230
*
232231
* In the case of uv_read_cb the uv_buf_t returned should be freed by the
@@ -263,7 +262,7 @@ typedef void (*uv_after_work_cb)(uv_work_t* req);
263262
* This will be called repeatedly after the uv_fs_event_t is initialized.
264263
* If uv_fs_event_t was initialized with a directory the filename parameter
265264
* will be a relative path to a file contained in the directory.
266-
* The events paramenter is an ORed mask of enum uv_fs_event elements.
265+
* The events parameter is an ORed mask of enum uv_fs_event elements.
267266
*/
268267
typedef void (*uv_fs_event_cb)(uv_fs_event_t* handle, const char* filename,
269268
int events, int status);
@@ -315,8 +314,8 @@ UV_PRIVATE_REQ_TYPES
315314
*
316315
* Shutdown the outgoing (write) side of a duplex stream. It waits for
317316
* pending write requests to complete. The handle should refer to a
318-
* initialized stream. req should be an uninitalized shutdown request
319-
* struct. The cb is a called after shutdown is complete.
317+
* initialized stream. req should be an uninitialized shutdown request
318+
* struct. The cb is called after shutdown is complete.
320319
*/
321320
UV_EXTERN int uv_shutdown(uv_shutdown_t* req, uv_stream_t* handle,
322321
uv_shutdown_cb cb);
@@ -345,8 +344,8 @@ struct uv_handle_s {
345344
};
346345

347346
/*
348-
* Returns 1 if the prepare/check/idle handle has been started, 0 otherwise.
349-
* For other handle types this always returns 1.
347+
* Returns 1 if the prepare/check/idle/timer handle has been started, 0
348+
* otherwise. For other handle types this always returns 1.
350349
*/
351350
UV_EXTERN int uv_is_active(uv_handle_t* handle);
352351

@@ -509,7 +508,7 @@ UV_EXTERN int uv_tcp_getpeername(uv_tcp_t* handle, struct sockaddr* name,
509508
* uv_tcp_connect, uv_tcp_connect6
510509
* These functions establish IPv4 and IPv6 TCP connections. Provide an
511510
* initialized TCP handle and an uninitialized uv_connect_t*. The callback
512-
* will be made when the connection is estabished.
511+
* will be made when the connection is established.
513512
*/
514513
UV_EXTERN int uv_tcp_connect(uv_connect_t* req, uv_tcp_t* handle,
515514
struct sockaddr_in address, uv_connect_cb cb);
@@ -884,7 +883,7 @@ UV_EXTERN int uv_timer_again(uv_timer_t* timer);
884883

885884
/*
886885
* Set the repeat value. Note that if the repeat value is set from a timer
887-
* callback it does not immediately take effect. If the timer was nonrepeating
886+
* callback it does not immediately take effect. If the timer was non-repeating
888887
* before, it will have been stopped. If it was repeating, then the old repeat
889888
* value will have been used to schedule the next timeout.
890889
*/
@@ -938,7 +937,7 @@ typedef struct uv_process_options_s {
938937
const char* file; /* Path to program to execute. */
939938
/*
940939
* Command line arguments. args[0] should be the path to the program. On
941-
* Windows this uses CreateProcess which concatinates the arguments into a
940+
* Windows this uses CreateProcess which concatenates the arguments into a
942941
* string this can cause some strange errors. See the note at
943942
* windows_verbatim_arguments.
944943
*/
@@ -962,7 +961,7 @@ typedef struct uv_process_options_s {
962961
/*
963962
* The user should supply pointers to initialized uv_pipe_t structs for
964963
* stdio. This is used to to send or receive input from the subprocess.
965-
* The user is reponsible for calling uv_close on them.
964+
* The user is responsible for calling uv_close on them.
966965
*/
967966
uv_pipe_t* stdin_stream;
968967
uv_pipe_t* stdout_stream;
@@ -1022,7 +1021,7 @@ UV_EXTERN int uv_queue_work(uv_loop_t* loop, uv_work_t* req,
10221021
* uninitialized uv_fs_t object.
10231022
*
10241023
* uv_fs_req_cleanup() must be called after completion of the uv_fs_
1025-
* function to free any internal memory allocations associted with the
1024+
* function to free any internal memory allocations associated with the
10261025
* request.
10271026
*/
10281027

@@ -1214,6 +1213,12 @@ UV_EXTERN int uv_ip6_name(struct sockaddr_in6* src, char* dst, size_t size);
12141213
/* Gets the executable path */
12151214
UV_EXTERN int uv_exepath(char* buffer, size_t* size);
12161215

1216+
/* Gets the current working directory */
1217+
UV_EXTERN uv_err_t uv_cwd(char* buffer, size_t size);
1218+
1219+
/* Changes the current working directory */
1220+
UV_EXTERN uv_err_t uv_chdir(const char* dir);
1221+
12171222
/* Gets memory info in bytes */
12181223
UV_EXTERN uint64_t uv_get_free_memory(void);
12191224
UV_EXTERN uint64_t uv_get_total_memory(void);

deps/uv/src/unix/core.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -845,3 +845,25 @@ size_t uv__strlcpy(char* dst, const char* src, size_t size) {
845845

846846
return src - org;
847847
}
848+
849+
850+
uv_err_t uv_cwd(char* buffer, size_t size) {
851+
if (!buffer || !size) {
852+
return uv__new_artificial_error(UV_EINVAL);
853+
}
854+
855+
if (getcwd(buffer, size)) {
856+
return uv_ok_;
857+
} else {
858+
return uv__new_sys_error(errno);
859+
}
860+
}
861+
862+
863+
uv_err_t uv_chdir(const char* dir) {
864+
if (chdir(dir) == 0) {
865+
return uv_ok_;
866+
} else {
867+
return uv__new_sys_error(errno);
868+
}
869+
}

deps/uv/src/win/cares.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ static void CALLBACK uv_ares_socksignal_tp(void* parameter,
6262
/* do not fail if error, thread may run after socket close */
6363
/* The code assumes that c-ares will write all pending data in the */
6464
/* callback, unless the socket would block. We can clear the state here */
65-
/* to avoid unecessary signals. */
65+
/* to avoid unnecessary signals. */
6666
WSAEnumNetworkEvents(sockhandle->sock,
6767
sockhandle->h_event,
6868
&network_events);
@@ -113,7 +113,7 @@ static void uv_ares_sockstate_cb(void *data, ares_socket_t sock, int read,
113113
if (read == 0 && write == 0) {
114114
/* if read and write are 0, cleanup existing data */
115115
/* The code assumes that c-ares does a callback with read = 0 and */
116-
/* write = 0 when the socket is closed. After we recieve this we stop */
116+
/* write = 0 when the socket is closed. After we receive this we stop */
117117
/* monitoring the socket. */
118118
if (uv_handle_ares != NULL) {
119119
uv_req_t* uv_ares_req;
@@ -244,7 +244,7 @@ void uv_process_ares_cleanup_req(uv_loop_t* loop, uv_ares_task_t* handle,
244244
}
245245
}
246246
} else {
247-
/* stil busy - repost and try again */
247+
/* still busy - repost and try again */
248248
POST_COMPLETION_FOR_REQ(loop, req);
249249
}
250250
}

deps/uv/src/win/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ static void uv_loop_init(uv_loop_t* loop) {
9191

9292

9393
static void uv_default_loop_init(void) {
94-
/* Intialize libuv itself first */
94+
/* Initialize libuv itself first */
9595
uv_once(&uv_init_guard_, uv_init);
9696

9797
/* Initialize the main loop */

deps/uv/src/win/pipe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ void uv_pipe_endgame(uv_loop_t* loop, uv_pipe_t* handle) {
249249
return;
250250
}
251251

252-
/* Run FlushFileBuffers in the thhead pool. */
252+
/* Run FlushFileBuffers in the thread pool. */
253253
result = QueueUserWorkItem(pipe_shutdown_thread_proc,
254254
req,
255255
WT_EXECUTELONGFUNCTION);

deps/uv/src/win/process.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ static wchar_t* path_search_walk_ext(const wchar_t *dir,
254254
* - CMD does not trim leading/trailing whitespace from path/pathex entries
255255
* nor from the environment variables as a whole.
256256
*
257-
* - When cmd.exe cannot read a directory, it wil just skip it and go on
257+
* - When cmd.exe cannot read a directory, it will just skip it and go on
258258
* searching. However, unlike posix-y systems, it will happily try to run a
259259
* file that is not readable/executable; if the spawn fails it will not
260260
* continue searching.
@@ -400,7 +400,7 @@ wchar_t* quote_cmd_arg(const wchar_t *source, wchar_t *target) {
400400
}
401401

402402
/*
403-
* Expected intput/output:
403+
* Expected input/output:
404404
* input : hello"world
405405
* output: "hello\"world"
406406
* input : hello""world
@@ -1018,7 +1018,7 @@ int uv_spawn(uv_loop_t* loop, uv_process_t* process,
10181018

10191019
} else {
10201020
/* CreateProcessW failed, but this failure should be delivered */
1021-
/* asynchronously to retain unix compatibility. So pretent spawn */
1021+
/* asynchronously to retain unix compatibility. So pretend spawn */
10221022
/* succeeded, and start a thread instead that prints an error */
10231023
/* to the child's intended stderr. */
10241024
process->spawn_errno = GetLastError();
@@ -1046,7 +1046,7 @@ int uv_spawn(uv_loop_t* loop, uv_process_t* process,
10461046
close_child_stdio(process);
10471047
} else {
10481048
/* We're keeping the handles open, the thread pool is going to have */
1049-
/* it's way with them. But at least make them noninheritable. */
1049+
/* it's way with them. But at least make them non-inheritable. */
10501050
int i;
10511051
for (i = 0; i < COUNTOF(process->child_stdio); i++) {
10521052
SetHandleInformation(child_stdio[i], HANDLE_FLAG_INHERIT, 0);

deps/uv/src/win/tcp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,7 @@ int uv_tcp_duplicate_socket(uv_tcp_t* handle, int pid,
10841084
/*
10851085
* We're about to share the socket with another process. Because
10861086
* this is a listening socket, we assume that the other process will
1087-
* be accepting conections on it. So, before sharing the socket
1087+
* be accepting connections on it. So, before sharing the socket
10881088
* with another process, we call listen here in the parent process.
10891089
* This needs to be modified if the socket is shared with
10901090
* another process for anything other than accepting connections.
@@ -1137,7 +1137,7 @@ int uv_tcp_simultaneous_accepts(uv_tcp_t* handle, int enable) {
11371137

11381138
handle->flags |= UV_HANDLE_TCP_SINGLE_ACCEPT;
11391139

1140-
/* Flip the changing flag if we have already queueed multiple accepts. */
1140+
/* Flip the changing flag if we have already queued multiple accepts. */
11411141
if (handle->flags & UV_HANDLE_LISTENING) {
11421142
handle->flags |= UV_HANDLE_TCP_ACCEPT_STATE_CHANGING;
11431143
}

deps/uv/src/win/timer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ uint64_t uv_hrtime(void) {
8686
return 0;
8787
}
8888

89-
/* Because we have no guarantee about the order of magniture of the */
89+
/* Because we have no guarantee about the order of magnitude of the */
9090
/* performance counter frequency, and there may not be much headroom to */
9191
/* multiply by NANOSEC without overflowing, we use 128-bit math instead. */
9292
return ((uint64_t) counter.LowPart * NANOSEC / uv_hrtime_frequency_) +

deps/uv/src/win/tty.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ int uv_tty_read_start(uv_tty_t* handle, uv_alloc_cb alloc_cb,
739739
handle->read_cb = read_cb;
740740
handle->alloc_cb = alloc_cb;
741741

742-
/* If reading was stopped and then started again, there could stell be a */
742+
/* If reading was stopped and then started again, there could still be a */
743743
/* read request pending. */
744744
if (handle->flags & UV_HANDLE_READ_PENDING) {
745745
return 0;
@@ -1258,7 +1258,8 @@ static int uv_tty_write_bufs(uv_tty_t* handle, uv_buf_t bufs[], int bufcnt,
12581258
#ifdef _MSC_VER /* msvc */
12591259
if (_BitScanReverse(&first_zero_bit, not_c)) {
12601260
#else /* assume gcc */
1261-
if (first_zero_bit = __builtin_clzl(not_c), c != 0) {
1261+
if (c != 0) {
1262+
first_zero_bit = (sizeof(int) * 8) - 1 - __builtin_clz(not_c);
12621263
#endif
12631264
if (first_zero_bit == 7) {
12641265
/* Ascii - pass right through */

deps/uv/src/win/udp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ int uv_udp_recv_start(uv_udp_t* handle, uv_alloc_cb alloc_cb,
362362
handle->recv_cb = recv_cb;
363363
handle->alloc_cb = alloc_cb;
364364

365-
/* If reading was stopped and then started again, there could stell be a */
365+
/* If reading was stopped and then started again, there could still be a */
366366
/* recv request pending. */
367367
if (!(handle->flags & UV_HANDLE_READ_PENDING))
368368
uv_udp_queue_recv(loop, handle);

0 commit comments

Comments
 (0)