summaryrefslogtreecommitdiff
path: root/deps/uv/src/unix/sunos.c
diff options
context:
space:
mode:
authorTimothy J Fontaine <tjfontaine@gmail.com>2014-02-26 18:08:30 -0800
committerTimothy J Fontaine <tjfontaine@gmail.com>2014-02-26 18:08:30 -0800
commitcd08c8a0e5e99ed4933b87fc5e188afcd4299f73 (patch)
treec05e93d47f89df1f7a782ee9c70bb2c97d557cd4 /deps/uv/src/unix/sunos.c
parentf3189ace6b5e31a874df421ac2f74da0e77cb14d (diff)
downloadandroid-node-v8-cd08c8a0e5e99ed4933b87fc5e188afcd4299f73.tar.gz
android-node-v8-cd08c8a0e5e99ed4933b87fc5e188afcd4299f73.tar.bz2
android-node-v8-cd08c8a0e5e99ed4933b87fc5e188afcd4299f73.zip
uv: Upgrade to v0.11.21
Diffstat (limited to 'deps/uv/src/unix/sunos.c')
-rw-r--r--deps/uv/src/unix/sunos.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/deps/uv/src/unix/sunos.c b/deps/uv/src/unix/sunos.c
index f31a23fb3c..b8a39c7017 100644
--- a/deps/uv/src/unix/sunos.c
+++ b/deps/uv/src/unix/sunos.c
@@ -372,11 +372,14 @@ static void uv__fs_event_read(uv_loop_t* loop,
assert(events != 0);
handle->fd = PORT_FIRED;
handle->cb(handle, NULL, events, 0);
+
+ if (handle->fd != PORT_DELETED) {
+ r = uv__fs_event_rearm(handle);
+ if (r != 0)
+ handle->cb(handle, NULL, 0, r);
+ }
}
while (handle->fd != PORT_DELETED);
-
- if (handle != NULL && handle->fd != PORT_DELETED)
- uv__fs_event_rearm(handle); /* FIXME(bnoordhuis) Check return code. */
}
@@ -388,10 +391,11 @@ int uv_fs_event_init(uv_loop_t* loop, uv_fs_event_t* handle) {
int uv_fs_event_start(uv_fs_event_t* handle,
uv_fs_event_cb cb,
- const char* filename,
+ const char* path,
unsigned int flags) {
int portfd;
int first_run;
+ int err;
if (uv__is_active(handle))
return -EINVAL;
@@ -406,13 +410,15 @@ int uv_fs_event_start(uv_fs_event_t* handle,
}
uv__handle_start(handle);
- handle->filename = strdup(filename);
+ handle->path = strdup(path);
handle->fd = PORT_UNUSED;
handle->cb = cb;
memset(&handle->fo, 0, sizeof handle->fo);
- handle->fo.fo_name = handle->filename;
- uv__fs_event_rearm(handle); /* FIXME(bnoordhuis) Check return code. */
+ handle->fo.fo_name = handle->path;
+ err = uv__fs_event_rearm(handle);
+ if (err != 0)
+ return err;
if (first_run) {
uv__io_init(&handle->loop->fs_event_watcher, uv__fs_event_read, portfd);
@@ -434,8 +440,8 @@ int uv_fs_event_stop(uv_fs_event_t* handle) {
}
handle->fd = PORT_DELETED;
- free(handle->filename);
- handle->filename = NULL;
+ free(handle->path);
+ handle->path = NULL;
handle->fo.fo_name = NULL;
uv__handle_stop(handle);