Skip to content

Commit 3f92031

Browse files
committed
uv: upgrade to 01fbe7b
1 parent 8bdf6ba commit 3f92031

File tree

6 files changed

+49
-2
lines changed

6 files changed

+49
-2
lines changed

deps/uv/config-unix.mk

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ 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
5354
CPPFLAGS += -Isrc/ares/config_darwin
5455
LINKFLAGS+=-framework CoreServices
5556
OBJS += src/unix/darwin.o

deps/uv/src/unix/kqueue.c

+1
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ int uv_fs_event_init(uv_loop_t* loop,
116116

117117

118118
void uv__fs_event_destroy(uv_fs_event_t* handle) {
119+
uv__fs_event_stop(handle);
119120
free(handle->filename);
120121
uv__close(handle->fd);
121122
handle->fd = -1;

deps/uv/src/win/handle.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ uv_handle_type uv_guess_handle(uv_file file) {
3535
if (GetConsoleMode(handle, &mode)) {
3636
return UV_TTY;
3737
} else {
38-
return UV_UNKNOWN_HANDLE;
38+
return UV_FILE;
3939
}
4040

4141
case FILE_TYPE_PIPE:

deps/uv/test/test-fs-event.c

+41-1
Original file line numberDiff line numberDiff line change
@@ -267,4 +267,44 @@ TEST_IMPL(fs_event_no_callback_on_close) {
267267
r = uv_fs_rmdir(loop, &fs_req, "watch_dir", NULL);
268268

269269
return 0;
270-
}
270+
}
271+
272+
273+
static void fs_event_fail(uv_fs_event_t* handle, const char* filename,
274+
int events, int status) {
275+
ASSERT(0 && "should never be called");
276+
}
277+
278+
279+
static void timer_cb(uv_timer_t* handle, int status) {
280+
int r;
281+
282+
ASSERT(status == 0);
283+
284+
r = uv_fs_event_init(handle->loop, &fs_event, ".", fs_event_fail, 0);
285+
ASSERT(r != -1);
286+
287+
uv_close((uv_handle_t*)&fs_event, close_cb);
288+
uv_close((uv_handle_t*)handle, close_cb);
289+
}
290+
291+
292+
TEST_IMPL(fs_event_immediate_close) {
293+
uv_timer_t timer;
294+
uv_loop_t* loop;
295+
int r;
296+
297+
loop = uv_default_loop();
298+
299+
r = uv_timer_init(loop, &timer);
300+
ASSERT(r == 0);
301+
302+
r = uv_timer_start(&timer, timer_cb, 1, 0);
303+
ASSERT(r == 0);
304+
305+
uv_run(loop);
306+
307+
ASSERT(close_cb_called == 2);
308+
309+
return 0;
310+
}

deps/uv/test/test-list.h

+2
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ TEST_DECLARE (fs_event_watch_dir)
110110
TEST_DECLARE (fs_event_watch_file)
111111
TEST_DECLARE (fs_event_watch_file_current_dir)
112112
TEST_DECLARE (fs_event_no_callback_on_close)
113+
TEST_DECLARE (fs_event_immediate_close)
113114
TEST_DECLARE (fs_readdir_empty_dir)
114115
TEST_DECLARE (fs_readdir_file)
115116
TEST_DECLARE (fs_open_dir)
@@ -261,6 +262,7 @@ TASK_LIST_START
261262
TEST_ENTRY (fs_event_watch_file)
262263
TEST_ENTRY (fs_event_watch_file_current_dir)
263264
TEST_ENTRY (fs_event_no_callback_on_close)
265+
TEST_ENTRY (fs_event_immediate_close)
264266
TEST_ENTRY (fs_readdir_empty_dir)
265267
TEST_ENTRY (fs_readdir_file)
266268
TEST_ENTRY (fs_open_dir)

deps/uv/uv.gyp

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
'EIO_STACKSIZE=262144'
1010
],
1111
'conditions': [
12+
['OS=="mac"', {
13+
'defines': ['__DARWIN_64_BIT_INO_T=1'],
14+
}],
1215
['OS=="solaris"', {
1316
'cflags': ['-pthreads'],
1417
'ldlags': ['-pthreads'],

0 commit comments

Comments
 (0)