From 27fd6f9615f36aec71877e2b99aa3655e22da75d Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Tue, 13 Jun 2023 05:08:30 +0200 Subject: minor refactoring --- src/process.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/process.c') diff --git a/src/process.c b/src/process.c index f38f4f5..c908f5c 100644 --- a/src/process.c +++ b/src/process.c @@ -85,10 +85,11 @@ static int redirect_and_exec_child(int pipe_fds[2], const char *args[], const ch int proc_capture(const char *args[], const char *envp[], struct proc_output *result) { + static const int flags = O_CLOEXEC; int pipe_fds[2]; int ret = 0; - ret = pipe2(pipe_fds, O_CLOEXEC); + ret = pipe2(pipe_fds, flags); if (ret < 0) { log_errno("pipe2"); return -1; -- cgit v1.3