diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/firejail/join.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/firejail/join.c b/src/firejail/join.c index c2b207c52..c849b200c 100644 --- a/src/firejail/join.c +++ b/src/firejail/join.c | |||
@@ -436,8 +436,18 @@ void join(pid_t pid, int argc, char **argv, int index) { | |||
436 | // it will never get here!!! | 436 | // it will never get here!!! |
437 | } | 437 | } |
438 | 438 | ||
439 | int status = 0; | ||
439 | // wait for the child to finish | 440 | // wait for the child to finish |
440 | waitpid(child, NULL, 0); | 441 | waitpid(child, &status, 0); |
441 | flush_stdin(); | 442 | flush_stdin(); |
442 | exit(0); | 443 | |
444 | if (WIFEXITED(status)) { | ||
445 | status = WEXITSTATUS(status); | ||
446 | } else if (WIFSIGNALED(status)) { | ||
447 | status = WTERMSIG(status); | ||
448 | } else { | ||
449 | status = 0; | ||
450 | } | ||
451 | |||
452 | exit(status); | ||
443 | } | 453 | } |