X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fpipe.c;h=f10cc95fe51f1eaa65d8e38b15e5d4992f2db6f2;hb=2c18ba6d7d4466fb2f312c16e3b3f2b280bf5b58;hp=7623e69a146cd6fec4916219e8857565c3ed5b06;hpb=2306ca2f8c0498f1c576ac53feaca869167d8220;p=gnulib.git diff --git a/lib/pipe.c b/lib/pipe.c index 7623e69a1..f10cc95fe 100644 --- a/lib/pipe.c +++ b/lib/pipe.c @@ -1,11 +1,11 @@ /* Creation of subprocesses, communicating via pipes. - Copyright (C) 2001-2004 Free Software Foundation, Inc. + Copyright (C) 2001-2004, 2006-2007 Free Software Foundation, Inc. Written by Bruno Haible , 2001. - 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 - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,13 +13,10 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + along with this program. If not, see . */ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +#include /* Specification. */ #include "pipe.h" @@ -28,13 +25,9 @@ #include #include #include - -#ifdef HAVE_UNISTD_H -# include -#endif +#include #include "error.h" -#include "exit.h" #include "fatal-signal.h" #include "wait-process.h" #include "gettext.h" @@ -50,17 +43,17 @@ #else /* Unix API. */ -# ifdef HAVE_POSIX_SPAWN +# if HAVE_POSIX_SPAWN # include # else -# ifdef HAVE_VFORK_H +# if HAVE_VFORK_H # include # endif # endif #endif -#ifndef HAVE_ENVIRON_DECL +#if ! HAVE_ENVIRON_DECL extern char **environ; #endif @@ -74,6 +67,11 @@ extern char **environ; # define STDERR_FILENO 2 #endif +/* The results of open() in this file are not used with fchdir, + therefore save some unnecessary work in fchdir.c. */ +#undef open +#undef close + #ifdef EINTR