Skip to content

Commit

Permalink
src: remove freebsd SA_RESETHAND workaround
Browse files Browse the repository at this point in the history
This workaround should no longer be necessary with supported versions
of FreeSBD.

Originally introduced in commit b64983d ("src: reset signal handler
to SIG_DFL on FreeBSD") from March 2015.

Fixes: nodejs#27515
PR-URL: nodejs#27780
Refs: nodejs#27246 (comment)
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
bnoordhuis committed May 23, 2019
1 parent 165916b commit 6e79658
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,6 @@ void WaitForInspectorDisconnect(Environment* env) {
#ifdef __POSIX__
void SignalExit(int signo, siginfo_t* info, void* ucontext) {
uv_tty_reset_mode();
#ifdef __FreeBSD__
// FreeBSD has a nasty bug, see RegisterSignalHandler for details
struct sigaction sa;
memset(&sa, 0, sizeof(sa));
sa.sa_handler = SIG_DFL;
CHECK_EQ(sigaction(signo, &sa, nullptr), 0);
#endif
raise(signo);
}
#endif // __POSIX__
Expand Down Expand Up @@ -480,12 +473,7 @@ void RegisterSignalHandler(int signal,
struct sigaction sa;
memset(&sa, 0, sizeof(sa));
sa.sa_sigaction = handler;
#ifndef __FreeBSD__
// FreeBSD has a nasty bug with SA_RESETHAND reseting the SA_SIGINFO, that is
// in turn set for a libthr wrapper. This leads to a crash.
// Work around the issue by manually setting SIG_DFL in the signal handler
sa.sa_flags = reset_handler ? SA_RESETHAND : 0;
#endif
sigfillset(&sa.sa_mask);
CHECK_EQ(sigaction(signal, &sa, nullptr), 0);
}
Expand Down

0 comments on commit 6e79658

Please sign in to comment.