Lines Matching defs:handle
465 uv_fs_event_t* handle;
474 handle = container_of(w, uv_fs_event_t, event_watcher);
487 if (fcntl(handle->event_watcher.fd, F_GETPATH, pathbuf) == 0)
490 handle->cb(handle, path, events, 0);
492 if (handle->event_watcher.fd == -1)
506 int uv_fs_event_init(uv_loop_t* loop, uv_fs_event_t* handle) {
507 uv__handle_init(loop, (uv_handle_t*)handle, UV_FS_EVENT);
512 int uv_fs_event_start(uv_fs_event_t* handle,
521 if (uv__is_active(handle))
524 handle->cb = cb;
525 handle->path = uv__strdup(path);
526 if (handle->path == NULL)
530 fd = open(handle->path, O_RDONLY);
532 uv__free(handle->path);
533 handle->path = NULL;
539 handle->cf_cb = NULL;
540 handle->realpath = NULL;
541 handle->realpath_len = 0;
542 handle->cf_flags = flags;
554 handle->event_watcher.fd = -1;
555 r = uv__fsevents_init(handle);
557 uv__handle_start(handle);
559 uv__free(handle->path);
560 handle->path = NULL;
567 uv__handle_start(handle);
568 uv__io_init(&handle->event_watcher, uv__fs_event, fd);
569 uv__io_start(handle->loop, &handle->event_watcher, POLLIN);
575 int uv_fs_event_stop(uv_fs_event_t* handle) {
579 if (!uv__is_active(handle))
582 uv__handle_stop(handle);
586 if (handle->cf_cb != NULL)
587 r = uv__fsevents_close(handle);
590 if (handle->event_watcher.fd != -1) {
591 uv__io_close(handle->loop, &handle->event_watcher);
592 uv__close(handle->event_watcher.fd);
593 handle->event_watcher.fd = -1;
596 uv__free(handle->path);
597 handle->path = NULL;
603 void uv__fs_event_close(uv_fs_event_t* handle) {
604 uv_fs_event_stop(handle);