Skip to content

Commit

Permalink
Use exit code 128+n.
Browse files Browse the repository at this point in the history
  • Loading branch information
jvalteren committed Jul 6, 2023
1 parent eddb71f commit 8f7985d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/debugUnix.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,15 @@ void terminateHandler(int sig, siginfo_t *info, ucontext_t *uap)

logWarn("VM terminated with signal %s", fault);

if(getLogLevel() >= LOG_DEBUG){
if(getLogLevel() >= LOG_DEBUG) {
doReport(fault, uap);
}

logWarn("Exiting with error code 1");
exit(1);
/* See exit code guideline: https://tldp.org/LDP/abs/html/exitcodes.html */
int exit_code = 128 + sig;

logWarn("Exiting with error code %d", exit_code);
exit(exit_code);
}


Expand Down

0 comments on commit 8f7985d

Please sign in to comment.