aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar startx2017 <vradu.startx@yandex.com>2018-10-18 08:14:13 -0400
committerLibravatar startx2017 <vradu.startx@yandex.com>2018-10-18 08:14:13 -0400
commit73855cd93719d49922e094ba726f6a16d2efd003 (patch)
tree8a1ea90cc24b3141b4bf508aa3ee0bb7446fe5b2 /src
parentstatus (diff)
downloadfirejail-73855cd93719d49922e094ba726f6a16d2efd003.tar.gz
firejail-73855cd93719d49922e094ba726f6a16d2efd003.tar.zst
firejail-73855cd93719d49922e094ba726f6a16d2efd003.zip
mainline merge: Make --join return exit code of the invoked program
Diffstat (limited to 'src')
-rw-r--r--src/firejail/join.c14
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}