Skip to content

Commit

Permalink
Save and regurgitate exit status at END
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanconn committed Jan 9, 2023
1 parent 2be5f87 commit cc6be07
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions starcheck/src/starcheck.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1165,6 +1165,10 @@ sub usage
}

END {
# Keep and return program exit status at end of END.
my $exit_status = $?;

# If the Python process id is defined, kill that process and wait
if (defined $pid) {
if ($par{verbose} gt 1){
my $server_calls = call_python("get_server_calls");
Expand All @@ -1178,6 +1182,7 @@ END
kill 9, $pid; # must it be 9 (SIGKILL)?
my $gone_pid = waitpid $pid, 0; # then check that it's gone
}
exit($exit_status);
};

=pod
Expand Down

0 comments on commit cc6be07

Please sign in to comment.