From 9f2dc700815c4df582966215f1982828125c5310 Mon Sep 17 00:00:00 2001 From: James Reggio Date: Wed, 6 Apr 2016 21:00:04 -0400 Subject: [PATCH] src: add SIGINFO to supported signals Though not a POSIX signal, SIGINFO is supported by BSD systems (including Mac OS X) and is amongst the few signals that can be triggered in a terminal via a simple key combination (CTRL-T). On Linux, SIGINFO is an alias for SIGPWR; hence the defensive conditionals in src/node.cc. PR-URL: https://github.com/nodejs/node/pull/6093 Reviewed-By: Ben Noordhuis Reviewed-By: James M Snell --- src/node.cc | 6 ++++++ src/node_constants.cc | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/src/node.cc b/src/node.cc index 42e24a718c5475..612a11524e5f61 100644 --- a/src/node.cc +++ b/src/node.cc @@ -692,6 +692,12 @@ const char *signo_string(int signo) { # endif #endif +#ifdef SIGINFO +# if !defined(SIGPWR) || SIGINFO != SIGPWR + SIGNO_CASE(SIGINFO); +# endif +#endif + #ifdef SIGSYS SIGNO_CASE(SIGSYS); #endif diff --git a/src/node_constants.cc b/src/node_constants.cc index ed75b01fbf9213..87443c95be1b6d 100644 --- a/src/node_constants.cc +++ b/src/node_constants.cc @@ -716,6 +716,10 @@ void DefineSignalConstants(Local target) { NODE_DEFINE_CONSTANT(target, SIGPWR); #endif +#ifdef SIGINFO + NODE_DEFINE_CONSTANT(target, SIGINFO); +#endif + #ifdef SIGSYS NODE_DEFINE_CONSTANT(target, SIGSYS); #endif