summaryrefslogtreecommitdiff
path: root/ACE/bin
diff options
context:
space:
mode:
authorSon Dinh <dinhs@objectcomputing.com>2022-03-21 23:21:28 -0500
committerSon Dinh <dinhs@objectcomputing.com>2022-03-21 23:21:28 -0500
commit34602aeea68e0c364b87c2de7b4215839f7807f2 (patch)
tree3fb583ef6d72ec33ba7c95c84bd338cd78eac485 /ACE/bin
parent22ce86fb8a3e49b417e04aff57ee386e9085545a (diff)
downloadATCD-34602aeea68e0c364b87c2de7b4215839f7807f2.tar.gz
Return signal code if any
Diffstat (limited to 'ACE/bin')
-rw-r--r--ACE/bin/PerlACE/Process_Unix.pm18
1 files changed, 11 insertions, 7 deletions
diff --git a/ACE/bin/PerlACE/Process_Unix.pm b/ACE/bin/PerlACE/Process_Unix.pm
index 73b2b706665..7b540ca170f 100644
--- a/ACE/bin/PerlACE/Process_Unix.pm
+++ b/ACE/bin/PerlACE/Process_Unix.pm
@@ -582,7 +582,7 @@ sub WaitKill ($)
return 0;
}
- my $status = $self->TimedWait ($timeout);
+ my ($status, $sigcode) = $self->TimedWait ($timeout);
if ($status == -1) {
print STDERR "ERROR: $self->{EXECUTABLE} timedout\n";
@@ -605,7 +605,7 @@ sub WaitKill ($)
$self->{RUNNING} = 0;
- return $status;
+ return (wantarray() ? ($status, $sigcode) : $status);
}
@@ -636,7 +636,10 @@ sub TerminateWaitKill ($)
return $self->WaitKill ($timeout);
}
-# really only for internal use
+# Really only for internal use.
+# The second returned parameter is the 8 bits indicating
+# whether there was a core dump and the the signal the process
+# died from, if any.
sub check_return_value ($)
{
my $self = shift;
@@ -656,13 +659,14 @@ sub check_return_value ($)
return ($rc >> 8);
}
elsif (($rc & 0xff) == 0) {
- $rc >>= 8;
- return $rc;
+ return ($rc >> 8);
}
# Ignore NSK 16-bit completion code
$rc &= 0xff if $is_NSK;
+ my $rc_copy = $rc;
+
# Remember Core dump flag
my $dump = 0;
@@ -673,7 +677,7 @@ sub check_return_value ($)
# check for ABRT, KILL or TERM
if ($rc == 6 || $rc == 9 || $rc == 15) {
- return 0;
+ return (0, $rc_copy);
}
print STDERR "ERROR: <", $self->{EXECUTABLE},
@@ -683,7 +687,7 @@ sub check_return_value ($)
print STDERR "signal $rc : ", $signame[$rc], "\n";
- return 255;
+ return (255, $rc_copy);
}
# for internal use