diff options
-rw-r--r-- | src/firejail/fs_trace.c | 2 | ||||
-rw-r--r-- | src/firejail/join.c | 14 |
2 files changed, 13 insertions, 3 deletions
diff --git a/src/firejail/fs_trace.c b/src/firejail/fs_trace.c index 38ab7e2f8..235e09291 100644 --- a/src/firejail/fs_trace.c +++ b/src/firejail/fs_trace.c | |||
@@ -51,7 +51,7 @@ void fs_trace(void) { | |||
51 | FILE *fp = fopen(RUN_LDPRELOAD_FILE, "w"); | 51 | FILE *fp = fopen(RUN_LDPRELOAD_FILE, "w"); |
52 | if (!fp) | 52 | if (!fp) |
53 | errExit("fopen"); | 53 | errExit("fopen"); |
54 | const char *prefix = LIBDIR "/firejail"; | 54 | const char *prefix = RUN_FIREJAIL_LIB_DIR; |
55 | 55 | ||
56 | if (arg_trace) { | 56 | if (arg_trace) { |
57 | fprintf(fp, "%s/libtrace.so\n", prefix); | 57 | fprintf(fp, "%s/libtrace.so\n", prefix); |
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 | } |