From cc6be078d26757101f5ae595d3bbdc122e96c4a1 Mon Sep 17 00:00:00 2001 From: Jean Connelly Date: Mon, 9 Jan 2023 12:37:53 -0500 Subject: [PATCH] Save and regurgitate exit status at END --- starcheck/src/starcheck.pl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/starcheck/src/starcheck.pl b/starcheck/src/starcheck.pl index 66b5f059..cc0f77fb 100755 --- a/starcheck/src/starcheck.pl +++ b/starcheck/src/starcheck.pl @@ -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"); @@ -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