summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--archival/libunarchive/open_transformer.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/archival/libunarchive/open_transformer.c b/archival/libunarchive/open_transformer.c
index c1007f9..fb149fc 100644
--- a/archival/libunarchive/open_transformer.c
+++ b/archival/libunarchive/open_transformer.c
@@ -36,15 +36,16 @@ extern int open_transformer(int src_fd, int (*transformer)(int src_fd, int dst_f
if (pid == 0) {
/* child process */
- close(fd_pipe[0]); /* We don't wan't to read from the pipe */
+ close(fd_pipe[0]); /* We don't wan't to read from the parent */
transformer(src_fd, fd_pipe[1]);
close(fd_pipe[1]); /* Send EOF */
+ close(src_fd);
exit(0);
/* notreached */
}
+
/* parent process */
- close(fd_pipe[1]); /* Don't want to write down the pipe */
- close(src_fd);
+ close(fd_pipe[1]); /* Don't want to write to the child */
return(fd_pipe[0]);
}