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 0fb3769
  • Loading branch information
bnoordhuis committed Nov 3, 2011
1 parent 818f0cb commit 52eaac4
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 1 deletion.
4 changes: 4 additions & 0 deletions deps/uv/src/unix/core.c
Expand Up @@ -599,7 +599,11 @@ static int uv_getaddrinfo_done(eio_req* req) {

if (handle->retcode == 0) {
/* OK */
#if EAI_NODATA /* FreeBSD deprecated EAI_NODATA */
} else if (handle->retcode == EAI_NONAME || handle->retcode == EAI_NODATA) {
#else
} else if (handle->retcode == EAI_NONAME) {
#endif
uv__set_sys_error(handle->loop, ENOENT); /* FIXME compatibility hack */
} else {
handle->loop->last_err.code = UV_EADDRINFO;
Expand Down
4 changes: 3 additions & 1 deletion deps/uv/src/win/fs-event.c
Expand Up @@ -353,7 +353,9 @@ void uv_process_fs_event_req(uv_loop_t* loop, uv_req_t* req,
offset = file_info->NextEntryOffset;
} while(offset);
} else {
handle->cb(handle, NULL, UV_CHANGE, 0);
if (!(handle->flags & UV_HANDLE_CLOSING)) {
handle->cb(handle, NULL, UV_CHANGE, 0);
}
}
} else {
uv__set_sys_error(loop, GET_REQ_ERROR(req));
Expand Down
29 changes: 29 additions & 0 deletions deps/uv/test/test-fs-event.c
Expand Up @@ -235,3 +235,32 @@ TEST_IMPL(fs_event_watch_file_current_dir) {
r = uv_fs_unlink(loop, &fs_req, "watch_file", NULL);
return 0;
}


TEST_IMPL(fs_event_no_callback_on_close) {
uv_fs_t fs_req;
uv_loop_t* loop = uv_default_loop();
int r;

/* Setup */
uv_fs_unlink(loop, &fs_req, "watch_dir/file1", NULL);
uv_fs_rmdir(loop, &fs_req, "watch_dir", NULL);
create_dir(loop, "watch_dir");
create_file(loop, "watch_dir/file1");

r = uv_fs_event_init(loop, &fs_event, "watch_dir/file1", fs_event_cb_file);
ASSERT(r != -1);

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

uv_run(loop);

ASSERT(fs_event_cb_called == 0);
ASSERT(close_cb_called == 1);

/* Cleanup */
r = uv_fs_unlink(loop, &fs_req, "watch_dir/file1", NULL);
r = uv_fs_rmdir(loop, &fs_req, "watch_dir", NULL);

return 0;
}
2 changes: 2 additions & 0 deletions deps/uv/test/test-list.h
Expand Up @@ -106,6 +106,7 @@ TEST_DECLARE (fs_stat_missing_path)
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_readdir_empty_dir)
TEST_DECLARE (fs_readdir_file)
TEST_DECLARE (fs_open_dir)
Expand Down Expand Up @@ -252,6 +253,7 @@ TASK_LIST_START
TEST_ENTRY (fs_event_watch_dir)
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_readdir_empty_dir)
TEST_ENTRY (fs_readdir_file)
TEST_ENTRY (fs_open_dir)
Expand Down

0 comments on commit 52eaac4

Please sign in to comment.