diff options
author | Glenn L McGrath <bug1@ihug.co.nz> | 2003-11-18 21:31:19 +0000 |
---|---|---|
committer | Glenn L McGrath <bug1@ihug.co.nz> | 2003-11-18 21:31:19 +0000 |
commit | 20872be9a4e670666b307f94b8fca6bf807c9b7b (patch) | |
tree | b611e7b17fd5f900bac0f3f70a2fc48caf11c9bf /archival/libunarchive | |
parent | 3b9fc8fe2a0fee6f1128f3f73ff408555ff45df8 (diff) | |
download | busybox-20872be9a4e670666b307f94b8fca6bf807c9b7b.tar.gz |
Dont close original file handle, we may need it later.
Diffstat (limited to 'archival/libunarchive')
-rw-r--r-- | archival/libunarchive/open_transformer.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/archival/libunarchive/open_transformer.c b/archival/libunarchive/open_transformer.c index c1007f982..fb149fc0b 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]); } |