Skip to content

Commit

Permalink
add a graceful way to terminate st-util
Browse files Browse the repository at this point in the history
  • Loading branch information
AJ528 committed May 11, 2024
1 parent 25785b9 commit 0c72598
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/st-util/gdb-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,13 @@ static void _cleanup() {
static void cleanup(int32_t signum) {
printf("Receive signal %i. Exiting...\n", signum);
_cleanup();
exit(1);
// if asked to gracefully terminate
if(signum == SIGTERM){
// return 0
exit(0);
}else{
exit(1);
}
(void)signum;
}

Expand Down

0 comments on commit 0c72598

Please sign in to comment.