From b970803c91400e07aac4a65fb2f0ad1f6b12327a Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 28 Apr 2004 06:30:05 +0000 Subject: [PATCH] Rewrite so that subpipe.h can stand alone. Assume C89 or better. --- lib/subpipe.c | 22 +++------------------- lib/subpipe.h | 6 +++++- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/lib/subpipe.c b/lib/subpipe.c index 7bb520a8..8722bac0 100644 --- a/lib/subpipe.c +++ b/lib/subpipe.c @@ -1,6 +1,6 @@ /* 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 it under the terms of the GNU General Public License as published by @@ -23,30 +23,16 @@ # include #endif -#if HAVE_SYS_TYPES_H -# include -#endif +#include "subpipe.h" #include -#ifndef errno -extern int errno; -#endif #include #if ! defined SIGCHLD && defined SIGCLD # define SIGCHLD SIGCLD #endif -#if HAVE_STDLIB_H -# include -#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 +#include #if HAVE_UNISTD_H # include @@ -86,8 +72,6 @@ extern int errno; #include "gettext.h" #define _(Msgid) gettext (Msgid) -#include "subpipe.h" - /* Initialize this module. */ diff --git a/lib/subpipe.h b/lib/subpipe.h index 6f4a592f..8e1eb8b4 100644 --- a/lib/subpipe.h +++ b/lib/subpipe.h @@ -1,5 +1,5 @@ /* 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. @@ -21,6 +21,10 @@ /* Written by Paul Eggert and Florian Krohm . */ +#if HAVE_SYS_TYPES_H +# include +#endif + void init_subpipe (void); pid_t create_subpipe (char const * const *, int[2]); void reap_subpipe (pid_t, char const *); -- 2.45.2