Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
uv: upgrade to b297d36
  • Loading branch information
bnoordhuis committed Nov 18, 2011
1 parent 59a9a9b commit 1e34c85
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 2 deletions.
1 change: 1 addition & 0 deletions deps/uv/config-unix.mk
Expand Up @@ -50,6 +50,7 @@ endif
ifeq (Darwin,$(uname_S))
EV_CONFIG=config_darwin.h
EIO_CONFIG=config_darwin.h
CPPFLAGS += -D__DARWIN_64_BIT_INO_T=1
CPPFLAGS += -Isrc/ares/config_darwin
LINKFLAGS+=-framework CoreServices
OBJS += src/unix/darwin.o
Expand Down
1 change: 1 addition & 0 deletions deps/uv/src/unix/kqueue.c
Expand Up @@ -116,6 +116,7 @@ int uv_fs_event_init(uv_loop_t* loop,


void uv__fs_event_destroy(uv_fs_event_t* handle) {
uv__fs_event_stop(handle);
free(handle->filename);
uv__close(handle->fd);
handle->fd = -1;
Expand Down
2 changes: 1 addition & 1 deletion deps/uv/src/win/handle.c
Expand Up @@ -35,7 +35,7 @@ uv_handle_type uv_guess_handle(uv_file file) {
if (GetConsoleMode(handle, &mode)) {
return UV_TTY;
} else {
return UV_UNKNOWN_HANDLE;
return UV_FILE;
}

case FILE_TYPE_PIPE:
Expand Down
42 changes: 41 additions & 1 deletion deps/uv/test/test-fs-event.c
Expand Up @@ -267,4 +267,44 @@ TEST_IMPL(fs_event_no_callback_on_close) {
r = uv_fs_rmdir(loop, &fs_req, "watch_dir", NULL);

return 0;
}
}


static void fs_event_fail(uv_fs_event_t* handle, const char* filename,
int events, int status) {
ASSERT(0 && "should never be called");
}


static void timer_cb(uv_timer_t* handle, int status) {
int r;

ASSERT(status == 0);

r = uv_fs_event_init(handle->loop, &fs_event, ".", fs_event_fail, 0);
ASSERT(r != -1);

uv_close((uv_handle_t*)&fs_event, close_cb);
uv_close((uv_handle_t*)handle, close_cb);
}


TEST_IMPL(fs_event_immediate_close) {
uv_timer_t timer;
uv_loop_t* loop;
int r;

loop = uv_default_loop();

r = uv_timer_init(loop, &timer);
ASSERT(r == 0);

r = uv_timer_start(&timer, timer_cb, 1, 0);
ASSERT(r == 0);

uv_run(loop);

ASSERT(close_cb_called == 2);

return 0;
}
2 changes: 2 additions & 0 deletions deps/uv/test/test-list.h
Expand Up @@ -110,6 +110,7 @@ TEST_DECLARE (fs_event_watch_dir)
TEST_DECLARE (fs_event_watch_file)
TEST_DECLARE (fs_event_watch_file_current_dir)
TEST_DECLARE (fs_event_no_callback_on_close)
TEST_DECLARE (fs_event_immediate_close)
TEST_DECLARE (fs_readdir_empty_dir)
TEST_DECLARE (fs_readdir_file)
TEST_DECLARE (fs_open_dir)
Expand Down Expand Up @@ -261,6 +262,7 @@ TASK_LIST_START
TEST_ENTRY (fs_event_watch_file)
TEST_ENTRY (fs_event_watch_file_current_dir)
TEST_ENTRY (fs_event_no_callback_on_close)
TEST_ENTRY (fs_event_immediate_close)
TEST_ENTRY (fs_readdir_empty_dir)
TEST_ENTRY (fs_readdir_file)
TEST_ENTRY (fs_open_dir)
Expand Down
3 changes: 3 additions & 0 deletions deps/uv/uv.gyp
Expand Up @@ -9,6 +9,9 @@
'EIO_STACKSIZE=262144'
],
'conditions': [
['OS=="mac"', {
'defines': ['__DARWIN_64_BIT_INO_T=1'],
}],
['OS=="solaris"', {
'cflags': ['-pthreads'],
'ldlags': ['-pthreads'],
Expand Down

0 comments on commit 1e34c85

Please sign in to comment.