diff options
| author | Raven <citrons@mondecitronne.com> | 2026-11-27 04:01:43 -0600 |
|---|---|---|
| committer | Raven <citrons@mondecitronne.com> | 2026-11-27 04:01:43 -0600 |
| commit | c0a477105e31c54b00a06e0ec66eed243d6c2150 (patch) | |
| tree | 8ad61941683e09f9f78ae640898645e8a430f3e5 /src | |
| parent | d3b5ea00a47f1eda20d86129a4569ed75bbf7094 (diff) | |
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -177,12 +177,15 @@ static void handle_child() { if (w == -1) { return; } - if (w == pid && WIFEXITED(status)) { + if (w != pid) return; + if (WIFEXITED(status)) { is_child = false; detach(); - fprintf( - stderr, "child exited with status %d\n", WEXITSTATUS(status) - ); + fprintf(stderr, "child exited with status %d\n", WEXITSTATUS(status)); + } else if (WIFSIGNALED(status)) { + is_child = false; + detach(); + fprintf(stderr, "child terminated with signal %d\n", WTERMSIG(status)); } } |
