summaryrefslogtreecommitdiff
path: root/deps/uv/src/unix
diff options
context:
space:
mode:
authorSaúl Ibarra Corretgé <saghul@gmail.com>2015-09-11 17:55:29 +0200
committerBen Noordhuis <info@bnoordhuis.nl>2015-09-11 18:38:43 +0200
commit68dc69a382692f424c53b75724e684a406b195a1 (patch)
treeae2725deaaea798d3b61e2258ad329016f0b3ddd /deps/uv/src/unix
parent958a94e19dd6dda962cd690a5f4aa0ad02ac21bc (diff)
downloadandroid-node-v8-68dc69a382692f424c53b75724e684a406b195a1.tar.gz
android-node-v8-68dc69a382692f424c53b75724e684a406b195a1.tar.bz2
android-node-v8-68dc69a382692f424c53b75724e684a406b195a1.zip
deps: update libuv to version 1.7.4
PR-URL: https://github.com/nodejs/node/pull/2817 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'deps/uv/src/unix')
-rw-r--r--deps/uv/src/unix/freebsd.c14
-rw-r--r--deps/uv/src/unix/fs.c9
-rw-r--r--deps/uv/src/unix/process.c7
3 files changed, 17 insertions, 13 deletions
diff --git a/deps/uv/src/unix/freebsd.c b/deps/uv/src/unix/freebsd.c
index c838beb28e..c69608b139 100644
--- a/deps/uv/src/unix/freebsd.c
+++ b/deps/uv/src/unix/freebsd.c
@@ -240,17 +240,13 @@ error:
int uv_uptime(double* uptime) {
- time_t now;
- struct timeval info;
- size_t size = sizeof(info);
- static int which[] = {CTL_KERN, KERN_BOOTTIME};
-
- if (sysctl(which, 2, &info, &size, NULL, 0))
+ int r;
+ struct timespec sp;
+ r = clock_gettime(CLOCK_MONOTONIC, &sp);
+ if (r)
return -errno;
- now = time(NULL);
-
- *uptime = (double)(now - info.tv_sec);
+ *uptime = sp.tv_sec;
return 0;
}
diff --git a/deps/uv/src/unix/fs.c b/deps/uv/src/unix/fs.c
index 52082e9347..d739c28258 100644
--- a/deps/uv/src/unix/fs.c
+++ b/deps/uv/src/unix/fs.c
@@ -574,7 +574,14 @@ static ssize_t uv__fs_sendfile(uv_fs_t* req) {
r = sendfile(in_fd, out_fd, req->off, &len, NULL, 0);
#endif
- if (r != -1 || len != 0) {
+ /*
+ * The man page for sendfile(2) on DragonFly states that `len` contains
+ * a meaningful value ONLY in case of EAGAIN and EINTR.
+ * Nothing is said about it's value in case of other errors, so better
+ * not depend on the potential wrong assumption that is was not modified
+ * by the syscall.
+ */
+ if (r == 0 || ((errno == EAGAIN || errno == EINTR) && len != 0)) {
req->off += len;
return (ssize_t) len;
}
diff --git a/deps/uv/src/unix/process.c b/deps/uv/src/unix/process.c
index f2a83753ee..9fa061e6bc 100644
--- a/deps/uv/src/unix/process.c
+++ b/deps/uv/src/unix/process.c
@@ -226,13 +226,14 @@ static int uv__process_open_stream(uv_stdio_container_t* container,
int pipefds[2],
int writable) {
int flags;
+ int err;
if (!(container->flags & UV_CREATE_PIPE) || pipefds[0] < 0)
return 0;
- if (uv__close(pipefds[1]))
- if (errno != EINTR && errno != EINPROGRESS)
- abort();
+ err = uv__close(pipefds[1]);
+ if (err != 0 && err != -EINPROGRESS)
+ abort();
pipefds[1] = -1;
uv__nonblock(pipefds[0], 1);