Skip to content

Commit

Permalink
Merge pull request #1395 from AJ528/develop
Browse files Browse the repository at this point in the history
Added a graceful way to terminate st-util
  • Loading branch information
Nightwalker-87 committed May 29, 2024
2 parents f47c697 + b67a6c3 commit 3520d73
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/st-util/gdb-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,13 @@ static void _cleanup() {
static void cleanup(int32_t signum) {
printf("Receive signal %i. Exiting...\n", signum);
_cleanup();
exit(1);
(void)signum;
// if asked to gracefully terminate
if(signum == SIGTERM){
// return 0
exit(0);
}else{
exit(1);
}
}

#if defined(_WIN32)
Expand Down

0 comments on commit 3520d73

Please sign in to comment.