diff options
Diffstat (limited to 'Utilities/cmlibuv/src/unix/fsevents.c')
-rw-r--r-- | Utilities/cmlibuv/src/unix/fsevents.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/Utilities/cmlibuv/src/unix/fsevents.c b/Utilities/cmlibuv/src/unix/fsevents.c index 3883740..47d8024 100644 --- a/Utilities/cmlibuv/src/unix/fsevents.c +++ b/Utilities/cmlibuv/src/unix/fsevents.c @@ -379,7 +379,7 @@ static int uv__fsevents_create_stream(uv_loop_t* loop, CFArrayRef paths) { if (!pFSEventStreamStart(ref)) { pFSEventStreamInvalidate(ref); pFSEventStreamRelease(ref); - return -EMFILE; + return UV_EMFILE; } state->fsevent_stream = ref; @@ -440,7 +440,7 @@ static void uv__fsevents_reschedule(uv_fs_event_t* handle, uv__fsevents_destroy_stream(handle->loop); /* Any failure below will be a memory failure */ - err = -ENOMEM; + err = UV_ENOMEM; /* Create list of all watched paths */ uv_mutex_lock(&state->fsevent_mutex); @@ -474,7 +474,7 @@ static void uv__fsevents_reschedule(uv_fs_event_t* handle, /* Create new FSEventStream */ cf_paths = pCFArrayCreate(NULL, (const void**) paths, path_count, NULL); if (cf_paths == NULL) { - err = -ENOMEM; + err = UV_ENOMEM; goto final; } err = uv__fsevents_create_stream(handle->loop, cf_paths); @@ -528,7 +528,7 @@ static int uv__fsevents_global_init(void) { * but if it ever becomes one, we can turn the dynamic library handles into * per-event loop properties and have the dynamic linker keep track for us. */ - err = -ENOSYS; + err = UV_ENOSYS; core_foundation_handle = dlopen("/System/Library/Frameworks/" "CoreFoundation.framework/" "Versions/A/CoreFoundation", @@ -543,7 +543,7 @@ static int uv__fsevents_global_init(void) { if (core_services_handle == NULL) goto out; - err = -ENOENT; + err = UV_ENOENT; #define V(handle, symbol) \ do { \ *(void **)(&p ## symbol) = dlsym((handle), #symbol); \ @@ -607,7 +607,7 @@ static int uv__fsevents_loop_init(uv_loop_t* loop) { state = uv__calloc(1, sizeof(*state)); if (state == NULL) - return -ENOMEM; + return UV_ENOMEM; err = uv_mutex_init(&loop->cf_mutex); if (err) @@ -636,7 +636,7 @@ static int uv__fsevents_loop_init(uv_loop_t* loop) { ctx.perform = uv__cf_loop_cb; state->signal_source = pCFRunLoopSourceCreate(NULL, 0, &ctx); if (state->signal_source == NULL) { - err = -ENOMEM; + err = UV_ENOMEM; goto fail_signal_source_create; } @@ -655,7 +655,7 @@ static int uv__fsevents_loop_init(uv_loop_t* loop) { loop->cf_state = state; /* uv_thread_t is an alias for pthread_t. */ - err = -pthread_create(&loop->cf_thread, attr, uv__cf_loop_runner, loop); + err = UV__ERR(pthread_create(&loop->cf_thread, attr, uv__cf_loop_runner, loop)); if (attr != NULL) pthread_attr_destroy(attr); @@ -787,7 +787,7 @@ int uv__cf_loop_signal(uv_loop_t* loop, item = uv__malloc(sizeof(*item)); if (item == NULL) - return -ENOMEM; + return UV_ENOMEM; item->handle = handle; item->type = type; @@ -817,7 +817,7 @@ int uv__fsevents_init(uv_fs_event_t* handle) { /* Get absolute path to file */ handle->realpath = realpath(handle->path, NULL); if (handle->realpath == NULL) - return -errno; + return UV__ERR(errno); handle->realpath_len = strlen(handle->realpath); /* Initialize event queue */ @@ -830,7 +830,7 @@ int uv__fsevents_init(uv_fs_event_t* handle) { */ handle->cf_cb = uv__malloc(sizeof(*handle->cf_cb)); if (handle->cf_cb == NULL) { - err = -ENOMEM; + err = UV_ENOMEM; goto fail_cf_cb_malloc; } @@ -881,7 +881,7 @@ int uv__fsevents_close(uv_fs_event_t* handle) { uv__cf_loop_state_t* state; if (handle->cf_cb == NULL) - return -EINVAL; + return UV_EINVAL; /* Remove handle from the list */ state = handle->loop->cf_state; @@ -895,7 +895,7 @@ int uv__fsevents_close(uv_fs_event_t* handle) { assert(handle != NULL); err = uv__cf_loop_signal(handle->loop, handle, kUVCFLoopSignalClosing); if (err) - return -err; + return UV__ERR(err); /* Wait for deinitialization */ uv_sem_wait(&state->fsevent_sem); |