summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--util.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/util.c b/util.c
index aa6f401..aaddaa0 100644
--- a/util.c
+++ b/util.c
@@ -129,8 +129,10 @@ int pipe_cloexec(int pipefd[2]) {
}
if (fcntl(pipefd[0], F_SETFD, FD_CLOEXEC) == -1 || fcntl(pipefd[1], F_SETFD, FD_CLOEXEC) == -1) {
+ int error = errno;
close(pipefd[1]);
close(pipefd[0]);
+ errno = error;
return -1;
}