Skip to content

Commit 2056c89

Browse files
committed
fix: avoid to kill all process if pid is not 1
1 parent 6e7375a commit 2056c89

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

main.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,11 @@ static _Noreturn void main_pause(void) {
8888
set_handler(SIGTERM, SIG_DFL);
8989
set_handler(SIGCHLD, SIG_DFL);
9090

91-
_exit(kill_all_and_wait_till_complete() ? 0 : 1);
91+
if (getpid() == 1) {
92+
_exit(kill_all_and_wait_till_complete() ? 0 : 1);
93+
} else {
94+
_exit(0);
95+
}
9296
}
9397

9498
static pid_t cpid;

0 commit comments

Comments
 (0)