aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/firejail/join.c14
-rw-r--r--src/firejail/util.c7
2 files changed, 12 insertions, 9 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}
diff --git a/src/firejail/util.c b/src/firejail/util.c
index 0d1418b43..61330a87e 100644
--- a/src/firejail/util.c
+++ b/src/firejail/util.c
@@ -560,13 +560,6 @@ char *clean_pathname(const char *path) {
560 // remove a trailing slash 560 // remove a trailing slash
561 if (j > 1 && rv[j - 1] == '/') 561 if (j > 1 && rv[j - 1] == '/')
562 rv[j - 1] = '\0'; 562 rv[j - 1] = '\0';
563
564 size_t new_len = strlen(rv);
565 if (new_len < len) {
566 rv = realloc(rv, new_len + 1);
567 if (!rv)
568 errExit("realloc");
569 }
570 } 563 }
571 564
572 return rv; 565 return rv;