diff options
author | Jean-Baptiste BESNARD <jbbesnard@paratools.fr> | 2019-08-01 17:43:35 +0200 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2020-01-28 09:57:18 +0000 |
commit | bd3e8e669086c9ae6366a0b703e191daf5d0842d (patch) | |
tree | 5eaf6ffe11621a1cdcca3478bc77bd2eeb64be8f | |
parent | 320c0a442cddeee26cec78619992c641c7029a56 (diff) | |
download | bubblewrap-auto.tar.gz |
retcode: fix return code with syncfd and no event_fdauto
Closes: #325
Approved by: giuseppe
-rw-r--r-- | bubblewrap.c | 19 |
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) |