Commit 3f0847d
committed
Close unused ends of intermediate_pids_sockets sooner
Instead of making this conditional and keeping track of the correct
condition under which to call it, we can use cleanup_fdp(), which is
a no-op when called with a pointer to a negative number, to close the
socket unconditionally.
In the parent bwrap monitor process (outside the sandbox), we never
want to use the write end (which is reserved for the child), so we
can and should close it as soon as we have forked.
Conversely, in the child process, we never want to use the read end
(which is reserved for the parent), so we should close that as soon
as we know we are in the child.
Signed-off-by: Simon McVittie <smcv@collabora.com>1 parent 06bbd28 commit 3f0847d
1 file changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3143 | 3143 | | |
3144 | 3144 | | |
3145 | 3145 | | |
| 3146 | + | |
3146 | 3147 | | |
3147 | 3148 | | |
3148 | 3149 | | |
3149 | | - | |
3150 | 3150 | | |
3151 | 3151 | | |
3152 | 3152 | | |
| |||
3212 | 3212 | | |
3213 | 3213 | | |
3214 | 3214 | | |
| 3215 | + | |
| 3216 | + | |
3215 | 3217 | | |
3216 | 3218 | | |
3217 | 3219 | | |
| |||
3231 | 3233 | | |
3232 | 3234 | | |
3233 | 3235 | | |
3234 | | - | |
3235 | | - | |
3236 | 3236 | | |
3237 | 3237 | | |
3238 | 3238 | | |
| |||
0 commit comments