From fb80276084a9adc0014b1008f8bf8253f126293b Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Thu, 8 Jun 2023 23:57:49 +0200 Subject: add {file,net}_close as a wrapper to close(2) --- src/process.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/process.c') diff --git a/src/process.c b/src/process.c index c0888b4..f38f4f5 100644 --- a/src/process.c +++ b/src/process.c @@ -66,7 +66,7 @@ static int redirect_and_exec_child(int pipe_fds[2], const char *args[], const ch { int ret = 0; - log_errno_if(close(pipe_fds[0]), "close"); + file_close(pipe_fds[0]); ret = dup2(pipe_fds[1], STDOUT_FILENO); if (ret < 0) { @@ -103,7 +103,7 @@ int proc_capture(const char *args[], const char *envp[], struct proc_output *res if (!child_pid) exit(redirect_and_exec_child(pipe_fds, args, envp)); - log_errno_if(close(pipe_fds[1]), "close"); + file_close(pipe_fds[1]); ret = file_read(pipe_fds[0], &result->output, &result->output_len); if (ret < 0) @@ -119,7 +119,7 @@ free_output: free(result->output); close_pipe: - log_errno_if(close(pipe_fds[0]), "close"); + file_close(pipe_fds[0]); /* No errno checking here, we might've already closed the write end. */ close(pipe_fds[1]); -- cgit v1.3