summaryrefslogtreecommitdiff
path: root/src/output.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/output.c')
-rw-r--r--src/output.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/output.c b/src/output.c
index c5e9aab9..13991b88 100644
--- a/src/output.c
+++ b/src/output.c
@@ -21,12 +21,14 @@
#include <config.h>
#include "system.h"
+#include <assert.h>
#include <configmake.h>
#include <error.h>
#include <get-errno.h>
+#include <pipe.h>
#include <quotearg.h>
-#include <subpipe.h>
#include <timevar.h>
+#include <wait-process.h>
#include "complain.h"
#include "files.h"
@@ -622,7 +624,9 @@ output_skeleton (void)
argv[i++] = full_m4bison;
argv[i++] = full_skeleton;
argv[i++] = NULL;
+ assert(i <= sizeof argv / sizeof *argv);
}
+
/* When POSIXLY_CORRECT is set, some future versions of GNU M4 (most likely
2.0) may drop some of the GNU extensions that Bison's skeletons depend
upon. So that the next release of Bison is forward compatible with those
@@ -642,8 +646,9 @@ output_skeleton (void)
<http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>
for details. */
unsetenv ("POSIXLY_CORRECT");
- init_subpipe ();
- pid = create_subpipe (argv, filter_fd);
+ pid = create_pipe_bidi (argv[0], argv[0], argv,
+ false, true, true,
+ filter_fd);
free (full_m4sugar);
free (full_m4bison);
free (full_skeleton);
@@ -651,7 +656,7 @@ output_skeleton (void)
if (trace_flag & trace_muscles)
muscles_output (stderr);
{
- FILE *out = fdopen (filter_fd[0], "w");
+ FILE *out = fdopen (filter_fd[1], "w");
if (! out)
error (EXIT_FAILURE, get_errno (),
"fdopen");
@@ -661,14 +666,16 @@ output_skeleton (void)
/* Read and process m4's output. */
timevar_push (TV_M4);
- end_of_output_subpipe (pid, filter_fd);
- in = fdopen (filter_fd[1], "r");
+ in = fdopen (filter_fd[0], "r");
if (! in)
error (EXIT_FAILURE, get_errno (),
"fdopen");
scan_skel (in);
xfclose (in);
- reap_subpipe (pid, m4);
+ wait_subprocess (pid, m4,
+ true, false,
+ false, true,
+ 0);
timevar_pop (TV_M4);
}