Rewrite so that subpipe.h can stand alone. Assume C89 or better.

This commit is contained in:
Paul Eggert
2004-04-28 06:30:05 +00:00
parent 126e375187
commit b970803c91
2 changed files with 8 additions and 20 deletions

View File

@@ -1,6 +1,6 @@
/* Subprocesses with pipes. /* Subprocesses with pipes.
Copyright (C) 2002 Free Software Foundation, Inc. Copyright (C) 2002, 2004 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -23,30 +23,16 @@
# include <config.h> # include <config.h>
#endif #endif
#if HAVE_SYS_TYPES_H #include "subpipe.h"
# include <sys/types.h>
#endif
#include <errno.h> #include <errno.h>
#ifndef errno
extern int errno;
#endif
#include <signal.h> #include <signal.h>
#if ! defined SIGCHLD && defined SIGCLD #if ! defined SIGCHLD && defined SIGCLD
# define SIGCHLD SIGCLD # define SIGCHLD SIGCLD
#endif #endif
#if HAVE_STDLIB_H
#include <stdlib.h> #include <stdlib.h>
#endif
/* The following test is to work around the gross typo in
systems like Sony NEWS-OS Release 4.0C, whereby EXIT_FAILURE
is defined to 0, not 1. */
#if ! EXIT_FAILURE
# undef EXIT_FAILURE
# define EXIT_FAILURE 1
#endif
#if HAVE_UNISTD_H #if HAVE_UNISTD_H
# include <unistd.h> # include <unistd.h>
@@ -86,8 +72,6 @@ extern int errno;
#include "gettext.h" #include "gettext.h"
#define _(Msgid) gettext (Msgid) #define _(Msgid) gettext (Msgid)
#include "subpipe.h"
/* Initialize this module. */ /* Initialize this module. */

View File

@@ -1,5 +1,5 @@
/* Subprocesses with pipes. /* Subprocesses with pipes.
Copyright (C) 2002 Free Software Foundation, Inc. Copyright (C) 2002, 2004 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler. This file is part of Bison, the GNU Compiler Compiler.
@@ -21,6 +21,10 @@
/* Written by Paul Eggert <eggert@twinsun.com> /* Written by Paul Eggert <eggert@twinsun.com>
and Florian Krohm <florian@edamail.fishkill.ibm.com>. */ and Florian Krohm <florian@edamail.fishkill.ibm.com>. */
#if HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
void init_subpipe (void); void init_subpipe (void);
pid_t create_subpipe (char const * const *, int[2]); pid_t create_subpipe (char const * const *, int[2]);
void reap_subpipe (pid_t, char const *); void reap_subpipe (pid_t, char const *);