X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/0fab8d7b36f48823e5707c282dfdcc080a35a656..f8e1c9e55b6f51b5144ad19a7fc11d2a774c5d58:/lib/subpipe.c diff --git a/lib/subpipe.c b/lib/subpipe.c index 10b62f2c..4eee4a0f 100644 --- a/lib/subpipe.c +++ b/lib/subpipe.c @@ -44,9 +44,7 @@ # define STDOUT_FILENO 1 #endif #if ! HAVE_DUP2 && ! defined dup2 -# if HAVE_FCNTL_H -# include -# endif +# include # define dup2(f, t) (close (t), fcntl (f, F_DUPFD, t)) #endif @@ -109,11 +107,13 @@ create_subpipe (char const * const *argv, int fd[2]) || pipe (pipe_fd) != 0 || (fd[1] = fd_safer (pipe_fd[0])) < 0 || (child_fd[1] = fd_safer (pipe_fd[1])) < 0) - error (EXIT_FAILURE, errno, "pipe"); + error (EXIT_FAILURE, errno, + "pipe"); pid = vfork (); if (pid < 0) - error (EXIT_FAILURE, errno, "fork"); + error (EXIT_FAILURE, errno, + "fork"); if (! pid) { @@ -148,7 +148,8 @@ reap_subpipe (pid_t pid, char const *program) #if HAVE_WAITPID || defined waitpid int wstatus; if (waitpid (pid, &wstatus, 0) < 0) - error (EXIT_FAILURE, errno, "waitpid"); + error (EXIT_FAILURE, errno, + "waitpid"); else { int status = WIFEXITED (wstatus) ? WEXITSTATUS (wstatus) : -1; @@ -165,3 +166,8 @@ reap_subpipe (pid_t pid, char const *program) } #endif } + +void +end_of_output_subpipe (pid_t pid, int fd[2]) +{ +}