summaryrefslogtreecommitdiff
path: root/deps/uv/src/unix/process.c
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2017-07-06 19:12:45 -0400
committercjihrig <cjihrig@gmail.com>2017-07-13 11:25:10 -0400
commit462b2466b34724ce194b4249a3e241083eb753d3 (patch)
tree4b80e9f2431ae14a0c01e4621e7cb14c19256466 /deps/uv/src/unix/process.c
parent31417b68822abeced64eeb120f064d37bc133f7c (diff)
downloadandroid-node-v8-462b2466b34724ce194b4249a3e241083eb753d3.tar.gz
android-node-v8-462b2466b34724ce194b4249a3e241083eb753d3.tar.bz2
android-node-v8-462b2466b34724ce194b4249a3e241083eb753d3.zip
deps: upgrade libuv to 1.13.1
PR-URL: https://github.com/nodejs/node/pull/14117 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'deps/uv/src/unix/process.c')
-rw-r--r--deps/uv/src/unix/process.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/deps/uv/src/unix/process.c b/deps/uv/src/unix/process.c
index f2fe30521c..80b9686ec8 100644
--- a/deps/uv/src/unix/process.c
+++ b/deps/uv/src/unix/process.c
@@ -279,9 +279,12 @@ static void uv__process_child_init(const uv_process_options_t* options,
int stdio_count,
int (*pipes)[2],
int error_fd) {
+ sigset_t set;
int close_fd;
int use_fd;
+ int err;
int fd;
+ int n;
if (options->flags & UV_PROCESS_DETACHED)
setsid();
@@ -376,6 +379,31 @@ static void uv__process_child_init(const uv_process_options_t* options,
environ = options->env;
}
+ /* Reset signal disposition. Use a hard-coded limit because NSIG
+ * is not fixed on Linux: it's either 32, 34 or 64, depending on
+ * whether RT signals are enabled. We are not allowed to touch
+ * RT signal handlers, glibc uses them internally.
+ */
+ for (n = 1; n < 32; n += 1) {
+ if (n == SIGKILL || n == SIGSTOP)
+ continue; /* Can't be changed. */
+
+ if (SIG_ERR != signal(n, SIG_DFL))
+ continue;
+
+ uv__write_int(error_fd, -errno);
+ _exit(127);
+ }
+
+ /* Reset signal mask. */
+ sigemptyset(&set);
+ err = pthread_sigmask(SIG_SETMASK, &set, NULL);
+
+ if (err != 0) {
+ uv__write_int(error_fd, -err);
+ _exit(127);
+ }
+
execvp(options->file, options->args);
uv__write_int(error_fd, -errno);
_exit(127);