All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Commit 0cd2ea1b authored by Leigh B Stoller's avatar Leigh B Stoller

Fix up the signal handling code, use the sys_wait macros instead.

parent 235db86c
......@@ -10,6 +10,7 @@ use English;
use Getopt::Std;
use Socket;
use File::Basename;
use POSIX ":sys_wait_h";
#
# Parse an ns file. Since the parser runs arbitrary NS file for the user,
......@@ -291,11 +292,10 @@ my $errs;
}
close ERR;
if ($?) {
my $exit_status = $? >> 8;
my $exit_status = $?;
if ($exit_status > 128) {
if (WIFSIGNALED($exit_status)) {
# The POSIX module doesn't create constants for valid signals
# (including SIGBUS), thus we have to do it the hard way.
......@@ -306,7 +306,7 @@ if ($?) {
@sig_num{@names} = split ' ', $Config{sig_num};
foreach (@names) {$sig_name[$sig_num{$_}] ||= $_}
my $signal = $exit_status - 128;
my $signal = WTERMSIG($exit_status);
my $signame = $sig_name[$signal];
if (grep {$_ eq $signame} qw(ILL TRAP EMT FPE BUS SEGV SYS)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment