2 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
10 #include "unarchive.h"
12 /* transformer(), more than meets the eye */
13 int open_transformer(int src_fd, int (*transformer)(int src_fd, int dst_fd))
18 if (pipe(fd_pipe) != 0) {
19 bb_perror_msg_and_die("Can't create pipe");
24 bb_perror_msg_and_die("Fork failed");
29 close(fd_pipe[0]); /* We don't wan't to read from the parent */
30 transformer(src_fd, fd_pipe[1]);
31 close(fd_pipe[1]); /* Send EOF */
38 close(fd_pipe[1]); /* Don't want to write to the child */