summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2016-05-06 08:21:08 -0400
committerColin Walters (automation) <walters+githubbot@verbum.org>2016-05-06 16:55:40 +0000
commit3e97d7ebc9a0d1eebc04b6e5ec0bf9499c6dc17b (patch)
treea600ea9eda5e4d2871820eea8205a38891d8ff19
parent35e664940c2fcac779f24121b8d2e9c1af4bb40e (diff)
downloadbubblewrap-3e97d7ebc9a0d1eebc04b6e5ec0bf9499c6dc17b.tar.gz
Propagate exit status when not in a PID namespace
If we're not doing a PID namespace, we don't create a monitor process, which means that the code in `monitor_child()` needs to properly propagate the exit status from the signalfd. It might be better to change `monitor_child()` to be a `waitpid()` loop in this case, but I decided to go for the one liner fix that's an improvement in both cases anyways. I noticed this with: ``` bwrap --ro-bind / / --dev /dev true ``` exiting with code 1. Closes: #49 Approved by: rhatdan
-rw-r--r--bubblewrap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bubblewrap.c b/bubblewrap.c
index 2b59474..13cdc7b 100644
--- a/bubblewrap.c
+++ b/bubblewrap.c
@@ -274,7 +274,7 @@ monitor_child (int event_fd)
{
if (fdsi.ssi_signo != SIGCHLD)
die ("Read unexpected signal\n");
- exit (1);
+ exit (fdsi.ssi_status);
}
}
}