A recent bug fix in the Zig compiler made me realise this code was
unnecessarily carrying open file descriptors (the source ones to the dup2
operations) into the child process. We can address this and simplify the whole
situation by taking advantage of the dup2 happening before exec, and thus
close-on-exec does what we need.
A recent bug fix in the Zig compiler made me realise this code was unnecessarily carrying open file descriptors (the source ones to the
dup2
operations) into the child process. We can address this and simplify the whole situation by taking advantage of thedup2
happening before exec, and thus close-on-exec does what we need.