summaryrefslogtreecommitdiff
path: root/deps/uv/test/runner-unix.c
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2012-11-16 17:57:15 +0100
committerBen Noordhuis <info@bnoordhuis.nl>2012-11-16 17:58:42 +0100
commitb6a3b0a6297ee205aa34d357edd55b79f91cdf09 (patch)
treef962b088681f43d7a17615cad54fedbf938b00f8 /deps/uv/test/runner-unix.c
parente2bcff9aa75e51b9ba071330fe712180abed03e0 (diff)
downloadnode-new-b6a3b0a6297ee205aa34d357edd55b79f91cdf09.tar.gz
deps: upgrade libuv to 665a316
Diffstat (limited to 'deps/uv/test/runner-unix.c')
-rw-r--r--deps/uv/test/runner-unix.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/deps/uv/test/runner-unix.c b/deps/uv/test/runner-unix.c
index 1a54a1adb9..77c68dcd6c 100644
--- a/deps/uv/test/runner-unix.c
+++ b/deps/uv/test/runner-unix.c
@@ -40,11 +40,14 @@
/* Do platform-specific initialization. */
void platform_init(int argc, char **argv) {
+ const char* var = getenv("UV_RUN_AS_ROOT");
+
/* Running the tests as root is not smart - don't do it. */
- if (getuid() == 0) {
+ if (getuid() == 0 && (var == NULL || atoi(var) <= 0)) {
fprintf(stderr, "Running the tests as root is not safe.\n");
exit(1);
}
+
/* Disable stdio output buffering. */
setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stderr, NULL, _IONBF, 0);