summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Baptiste BESNARD <jbbesnard@paratools.fr>2019-08-01 17:43:35 +0200
committerAtomic Bot <atomic-devel@projectatomic.io>2020-01-28 09:57:09 +0000
commit5a3818e7424854d72092e67912176f2b4b8e5ae2 (patch)
tree5eaf6ffe11621a1cdcca3478bc77bd2eeb64be8f
parent320c0a442cddeee26cec78619992c641c7029a56 (diff)
downloadbubblewrap-homu-tmp.tar.gz
retcode: fix return code with syncfd and no event_fdhomu-tmp
Closes: #325 Approved by: giuseppe
-rw-r--r--bubblewrap.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/bubblewrap.c b/bubblewrap.c
index 8d0c5f7..89b696a 100644
--- a/bubblewrap.c
+++ b/bubblewrap.c
@@ -532,17 +532,20 @@ do_init (int event_fd, pid_t initial_pid, struct sock_fprog *seccomp_prog)
int status;
child = wait (&status);
- if (child == initial_pid && event_fd != -1)
+ if (child == initial_pid)
{
- uint64_t val;
- int res UNUSED;
-
initial_exit_status = propagate_exit_status (status);
- val = initial_exit_status + 1;
- res = write (event_fd, &val, 8);
- /* Ignore res, if e.g. the parent died and closed event_fd
- we don't want to error out here */
+ if(event_fd != -1)
+ {
+ uint64_t val;
+ int res UNUSED;
+
+ val = initial_exit_status + 1;
+ res = write (event_fd, &val, 8);
+ /* Ignore res, if e.g. the parent died and closed event_fd
+ we don't want to error out here */
+ }
}
if (child == -1 && errno != EINTR)