diff options
author | Fedor Indutny <fedor.indutny@gmail.com> | 2013-12-13 22:35:09 +0400 |
---|---|---|
committer | Fedor Indutny <fedor.indutny@gmail.com> | 2013-12-13 22:35:09 +0400 |
commit | f61d9405bfcf0fa113a13d57d41fef7d74a69538 (patch) | |
tree | 9618cb7ae2285c51ff6f73cdfb8356537d55e9e6 /deps/uv/src/unix/fsevents.c | |
parent | 069dd07a1732c6a752773aaed9e8c18ab472375f (diff) | |
download | android-node-v8-f61d9405bfcf0fa113a13d57d41fef7d74a69538.tar.gz android-node-v8-f61d9405bfcf0fa113a13d57d41fef7d74a69538.tar.bz2 android-node-v8-f61d9405bfcf0fa113a13d57d41fef7d74a69538.zip |
uv: Upgrade to v0.11.16
Diffstat (limited to 'deps/uv/src/unix/fsevents.c')
-rw-r--r-- | deps/uv/src/unix/fsevents.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/deps/uv/src/unix/fsevents.c b/deps/uv/src/unix/fsevents.c index 3618f46996..7faa1562a6 100644 --- a/deps/uv/src/unix/fsevents.c +++ b/deps/uv/src/unix/fsevents.c @@ -251,13 +251,15 @@ static void uv__fsevents_event_cb(ConstFSEventStreamRef streamRef, if (strncmp(path, handle->realpath, handle->realpath_len) != 0) continue; - path += handle->realpath_len; - len -= handle->realpath_len; - - /* Skip back slash */ - if (*path != 0) { - path++; - len--; + if (handle->realpath_len > 1 || *handle->realpath != '/') { + path += handle->realpath_len; + len -= handle->realpath_len; + + /* Skip forward slash */ + if (*path != '\0') { + path++; + len--; + } } #ifdef MAC_OS_X_VERSION_10_7 @@ -267,9 +269,9 @@ static void uv__fsevents_event_cb(ConstFSEventStreamRef streamRef, #endif /* MAC_OS_X_VERSION_10_7 */ /* Do not emit events from subdirectories (without option set) */ - if ((handle->cf_flags & UV_FS_EVENT_RECURSIVE) == 0) { - pos = strchr(path, '/'); - if (pos != NULL && pos != path + 1) + if ((handle->cf_flags & UV_FS_EVENT_RECURSIVE) == 0 && *path != 0) { + pos = strchr(path + 1, '/'); + if (pos != NULL) continue; } @@ -588,7 +590,7 @@ static int uv__fsevents_loop_init(uv_loop_t* loop) { err = uv_mutex_init(&loop->cf_mutex); if (err) - return err; + goto fail_mutex_init; err = uv_sem_init(&loop->cf_sem, 0); if (err) @@ -658,6 +660,8 @@ fail_fsevent_sem_init: fail_sem_init: uv_mutex_destroy(&loop->cf_mutex); + +fail_mutex_init: free(state); return err; } |