diff options
author | Saúl Ibarra Corretgé <saghul@gmail.com> | 2014-12-09 21:01:35 +0100 |
---|---|---|
committer | Trevor Norris <trev.norris@gmail.com> | 2014-12-09 17:03:50 -0800 |
commit | 20a7088d9c62c43fedf9ab077fbbeae92c7e6617 (patch) | |
tree | cd62507bde03fff1e59de67338f2b406d2221bdd /deps/uv/test/runner-unix.c | |
parent | 4dc660e164417e0a1bc86eadd825b41d7abb053f (diff) | |
download | android-node-v8-20a7088d9c62c43fedf9ab077fbbeae92c7e6617.tar.gz android-node-v8-20a7088d9c62c43fedf9ab077fbbeae92c7e6617.tar.bz2 android-node-v8-20a7088d9c62c43fedf9ab077fbbeae92c7e6617.zip |
deps: update libuv to 1.0.2
PR-URL: https://github.com/joyent/node/pull/8847
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Diffstat (limited to 'deps/uv/test/runner-unix.c')
-rw-r--r-- | deps/uv/test/runner-unix.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/deps/uv/test/runner-unix.c b/deps/uv/test/runner-unix.c index 9afcd1e488..1f12c6f12d 100644 --- a/deps/uv/test/runner-unix.c +++ b/deps/uv/test/runner-unix.c @@ -22,10 +22,11 @@ #include "runner-unix.h" #include "runner.h" +#include <limits.h> #include <stdint.h> /* uintptr_t */ #include <errno.h> -#include <unistd.h> /* usleep */ +#include <unistd.h> /* readlink, usleep */ #include <string.h> /* strdup */ #include <stdio.h> #include <stdlib.h> @@ -40,7 +41,7 @@ /* Do platform-specific initialization. */ -void platform_init(int argc, char **argv) { +int platform_init(int argc, char **argv) { const char* tap; tap = getenv("UV_TAP_OUTPUT"); @@ -49,8 +50,14 @@ void platform_init(int argc, char **argv) { /* Disable stdio output buffering. */ setvbuf(stdout, NULL, _IONBF, 0); setvbuf(stderr, NULL, _IONBF, 0); - strncpy(executable_path, argv[0], sizeof(executable_path) - 1); signal(SIGPIPE, SIG_IGN); + + if (realpath(argv[0], executable_path) == NULL) { + perror("realpath"); + return -1; + } + + return 0; } |