authorgravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2020-08-29 20:58:03+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-08-30 00:22:54-04:00
logff4fde767faec604958783f29fc2439b1badb0e0
tree76d36822a2e61443a069c29e64cfa66529d265ab
parent00301bbdd3d8e5df3ac147353e7cc9c67f65901f

std: Open the eventfd fd with CLOEXEC flag

Make sure the fd we use to communicate with the parent process is not leaked to the child process. Closes #5966

1 files changed, 1 insertions(+), 1 deletions(-)

lib/std/child_process.zig+1-1
......@@ -396,7 +396,7 @@ pub const ChildProcess = struct {
396396 // and execve from the child process to the parent process.
397397 const err_pipe = blk: {
398398 if (builtin.os.tag == .linux) {
399 const fd = try os.eventfd(0, 0);
399 const fd = try os.eventfd(0, os.EFD_CLOEXEC);
400400 // There's no distinction between the readable and the writeable
401401 // end with eventfd
402402 break :blk [2]os.fd_t{ fd, fd };