diff options
author | isaacs <i@izs.me> | 2012-07-20 10:01:46 -0700 |
---|---|---|
committer | isaacs <i@izs.me> | 2012-07-20 11:08:36 -0700 |
commit | e16d506a58d46619c05b08f3f8ef4d5491b18b69 (patch) | |
tree | 82d73799208905b6d6d290704987dafde583c603 /deps/uv/src/unix/sunos.c | |
parent | 85185bbbaa9e99bd77232f529687e9fa5d26af78 (diff) | |
download | android-node-v8-e16d506a58d46619c05b08f3f8ef4d5491b18b69.tar.gz android-node-v8-e16d506a58d46619c05b08f3f8ef4d5491b18b69.tar.bz2 android-node-v8-e16d506a58d46619c05b08f3f8ef4d5491b18b69.zip |
uv: Upgrade to ad382bca
Diffstat (limited to 'deps/uv/src/unix/sunos.c')
-rw-r--r-- | deps/uv/src/unix/sunos.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/deps/uv/src/unix/sunos.c b/deps/uv/src/unix/sunos.c index b95a89b456..a33ec9d98b 100644 --- a/deps/uv/src/unix/sunos.c +++ b/deps/uv/src/unix/sunos.c @@ -75,7 +75,6 @@ uint64_t uv_hrtime() { */ int uv_exepath(char* buffer, size_t* size) { ssize_t res; - pid_t pid; char buf[128]; if (buffer == NULL) @@ -84,8 +83,7 @@ int uv_exepath(char* buffer, size_t* size) { if (size == NULL) return (-1); - pid = getpid(); - (void) snprintf(buf, sizeof (buf), "/proc/%d/path/a.out", pid); + (void) snprintf(buf, sizeof(buf), "/proc/%lu/path/a.out", (unsigned long) getpid()); res = readlink(buf, buffer, *size - 1); if (res < 0) @@ -128,26 +126,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 +198,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; @@ -433,7 +432,8 @@ uv_err_t uv_interface_addresses(uv_interface_address_t** addresses, address = *addresses; for (ent = addrs; ent != NULL; ent = ent->ifa_next) { - bzero(&ip, sizeof (ip)); + memset(&ip, 0, sizeof(ip)); + if (!(ent->ifa_flags & IFF_UP && ent->ifa_flags & IFF_RUNNING)) { continue; } |