diff --git a/include/uv-private/uv-unix.h b/include/uv-private/uv-unix.h index da185e29..ea60799e 100644 --- a/include/uv-private/uv-unix.h +++ b/include/uv-private/uv-unix.h @@ -102,7 +102,7 @@ struct uv__io_s { int inotify_fd; #elif defined(PORT_SOURCE_FILE) # define UV_LOOP_PRIVATE_PLATFORM_FIELDS \ - ev_io fs_event_watcher; \ + uv__io_t fs_event_watcher; \ int fs_fd; #else # define UV_LOOP_PRIVATE_PLATFORM_FIELDS diff --git a/src/unix/sunos.c b/src/unix/sunos.c index 906e69fb..7ad816f9 100644 --- a/src/unix/sunos.c +++ b/src/unix/sunos.c @@ -128,26 +128,27 @@ static void uv__fs_event_rearm(uv_fs_event_t *handle) { } -static void uv__fs_event_read(EV_P_ ev_io* w, int revents) { +static void uv__fs_event_read(uv_loop_t* loop, uv__io_t* w, int revents) { uv_fs_event_t *handle; - uv_loop_t *loop_; timespec_t timeout; port_event_t pe; int events; int r; - loop_ = container_of(w, uv_loop_t, fs_event_watcher); + (void) w; + (void) revents; do { /* TODO use port_getn() */ do { memset(&timeout, 0, sizeof timeout); - r = port_get(loop_->fs_fd, &pe, &timeout); + r = port_get(loop->fs_fd, &pe, &timeout); } while (r == -1 && errno == EINTR); if (r == -1 && errno == ETIME) break; + handle = (uv_fs_event_t *)pe.portev_user; assert((r == 0) && "unexpected port_get() error"); @@ -199,8 +200,8 @@ int uv_fs_event_init(uv_loop_t* loop, uv__fs_event_rearm(handle); if (first_run) { - ev_io_init(&loop->fs_event_watcher, uv__fs_event_read, portfd, EV_READ); - ev_io_start(loop->ev, &loop->fs_event_watcher); + uv__io_init(&loop->fs_event_watcher, uv__fs_event_read, portfd, UV__IO_READ); + uv__io_start(loop, &loop->fs_event_watcher); } return 0;