Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
sunos: replace ev_io with uv__io_t
Browse files Browse the repository at this point in the history
  • Loading branch information
bnoordhuis committed Jun 22, 2012
1 parent f01e9d7 commit c222f07
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion include/uv-private/uv-unix.h
Expand Up @@ -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
Expand Down
13 changes: 7 additions & 6 deletions src/unix/sunos.c
Expand Up @@ -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");

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit c222f07

Please sign in to comment.