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 569cfcff7..731842275 100644 --- a/src/firejail/join.c +++ b/src/firejail/join.c | |||
@@ -386,8 +386,18 @@ void join(pid_t pid, int argc, char **argv, int index) { | |||
386 | // it will never get here!!! | 386 | // it will never get here!!! |
387 | } | 387 | } |
388 | 388 | ||
389 | int status = 0; | ||
389 | // wait for the child to finish | 390 | // wait for the child to finish |
390 | waitpid(child, NULL, 0); | 391 | waitpid(child, &status, 0); |
391 | flush_stdin(); | 392 | flush_stdin(); |
392 | exit(0); | 393 | |
394 | if (WIFEXITED(status)) { | ||
395 | status = WEXITSTATUS(status); | ||
396 | } else if (WIFSIGNALED(status)) { | ||
397 | status = WTERMSIG(status); | ||
398 | } else { | ||
399 | status = 0; | ||
400 | } | ||
401 | |||
402 | exit(status); | ||
393 | } | 403 | } |