diff options
author | turret <turret@duck.com> | 2024-01-11 19:16:21 +0000 |
---|---|---|
committer | turret <turret@duck.com> | 2024-01-11 19:16:21 +0000 |
commit | 1b61d9ddc1afdddd429e10eeda90a31ae7e69261 (patch) | |
tree | 254b91fada111dd8920e2f3e49b23a4e442e8df3 /init/init.c | |
parent | 9b126ca498e5c26a51997c9a87b5b01b152244fa (diff) | |
download | discord-bot-skeleton-1b61d9ddc1afdddd429e10eeda90a31ae7e69261.tar.gz discord-bot-skeleton-1b61d9ddc1afdddd429e10eeda90a31ae7e69261.tar.bz2 discord-bot-skeleton-1b61d9ddc1afdddd429e10eeda90a31ae7e69261.zip |
init: panic on child exit status !=0
also: modify log to exit status 0 on panic instead of 1 (only runs exit
on panicmode respawn which shouldn't cause a fatal termination)
Diffstat (limited to 'init/init.c')
-rw-r--r-- | init/init.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/init/init.c b/init/init.c index fa0e32f..e82a504 100644 --- a/init/init.c +++ b/init/init.c @@ -110,6 +110,9 @@ int main(void) if(subsystem_handle_term(process) > 0) print(LOG_WARNING "init: failed to reap process %d", process); + if(siginfo.si_status != 0) { + panic("init: process %d exited with non-zero status (%d)", siginfo.si_status); + } } } |