diff options
author | Brad King <brad.king@kitware.com> | 2019-06-18 11:45:53 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-06-18 11:45:53 (GMT) |
commit | 69b139cfca6c5eef64558070f533b6c898f410e0 (patch) | |
tree | 12d281e91cc1f71c56e2e1372589085df4df8265 /Utilities/cmlibuv/src/unix/sunos.c | |
parent | ab63072381171e9c5a7164536f0912b8b3a4a313 (diff) | |
parent | b4069b04ff63b327ff4881282200c3c73fded34d (diff) | |
download | CMake-69b139cfca6c5eef64558070f533b6c898f410e0.zip CMake-69b139cfca6c5eef64558070f533b6c898f410e0.tar.gz CMake-69b139cfca6c5eef64558070f533b6c898f410e0.tar.bz2 |
Merge branch 'upstream-libuv' into update-libuv
* upstream-libuv:
libuv 2019-06-10 (ee24ce90)
Diffstat (limited to 'Utilities/cmlibuv/src/unix/sunos.c')
-rw-r--r-- | Utilities/cmlibuv/src/unix/sunos.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/Utilities/cmlibuv/src/unix/sunos.c b/Utilities/cmlibuv/src/unix/sunos.c index aac6504..0cd25c1 100644 --- a/Utilities/cmlibuv/src/unix/sunos.c +++ b/Utilities/cmlibuv/src/unix/sunos.c @@ -121,6 +121,7 @@ void uv__platform_invalidate_fd(uv_loop_t* loop, int fd) { uintptr_t nfds; assert(loop->watchers != NULL); + assert(fd >= 0); events = (struct port_event*) loop->watchers[loop->nwatchers]; nfds = (uintptr_t) loop->watchers[loop->nwatchers + 1]; @@ -138,8 +139,10 @@ int uv__io_check_fd(uv_loop_t* loop, int fd) { if (port_associate(loop->backend_fd, PORT_SOURCE_FD, fd, POLLIN, 0)) return UV__ERR(errno); - if (port_dissociate(loop->backend_fd, PORT_SOURCE_FD, fd)) + if (port_dissociate(loop->backend_fd, PORT_SOURCE_FD, fd)) { + perror("(libuv) port_dissociate()"); abort(); + } return 0; } @@ -177,8 +180,14 @@ void uv__io_poll(uv_loop_t* loop, int timeout) { w = QUEUE_DATA(q, uv__io_t, watcher_queue); assert(w->pevents != 0); - if (port_associate(loop->backend_fd, PORT_SOURCE_FD, w->fd, w->pevents, 0)) + if (port_associate(loop->backend_fd, + PORT_SOURCE_FD, + w->fd, + w->pevents, + 0)) { + perror("(libuv) port_associate()"); abort(); + } w->events = w->pevents; } @@ -222,10 +231,12 @@ void uv__io_poll(uv_loop_t* loop, int timeout) { /* Work around another kernel bug: port_getn() may return events even * on error. */ - if (errno == EINTR || errno == ETIME) + if (errno == EINTR || errno == ETIME) { saved_errno = errno; - else + } else { + perror("(libuv) port_getn()"); abort(); + } } /* Update loop->time unconditionally. It's tempting to skip the update when @@ -373,6 +384,11 @@ uint64_t uv_get_total_memory(void) { } +uint64_t uv_get_constrained_memory(void) { + return 0; /* Memory constraints are unknown. */ +} + + void uv_loadavg(double avg[3]) { (void) getloadavg(avg, 3); } |