From 020ecb1b4f516fc98b51ed2b6fc43d16b660fb07 Mon Sep 17 00:00:00 2001 From: ghazi Date: Mon, 2 Nov 1998 07:20:48 +0000 Subject: * configure.in: Call AC_FUNC_VFORK. * collect2.c: Define VFORK_STRING as a printable string for error messages (either "vfork" or "fork".) If HAVE_VFORK_H is defined, include vfork.h. If VMS is defined, define vfork() appropriately. Remove vfork check on USG, we're using autoconf. (collect_execute): Pass VFORK_STRING to fatal_perror instead of checking locally what string to pass. (scan_prog_file): Likewise. (scan_libraries): Likewise. * gcc.c: Remove vfork check on USG, we're using autoconf. Besides, no calls to vfork/fork occur in this file. * protoize.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@23498 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/collect2.c | 41 ++++++++++++++++------------------------- 1 file changed, 16 insertions(+), 25 deletions(-) (limited to 'gcc/collect2.c') diff --git a/gcc/collect2.c b/gcc/collect2.c index 166cbe1c483..5fdd08bedf5 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -30,6 +30,19 @@ Boston, MA 02111-1307, USA. */ #include #include +#ifdef vfork /* Autoconf may define this to fork for us. */ +# define VFORK_STRING "fork" +#else +# define VFORK_STRING "vfork" +#endif +#ifdef HAVE_VFORK_H +#include +#endif +#ifdef VMS +#define vfork() (decc$$alloc_vfork_blocks() >= 0 ? \ + lib$get_current_invo_context(decc$$get_vfork_jmpbuf()) : -1) +#endif /* VMS */ + #define COLLECT #include "demangle.h" @@ -43,10 +56,6 @@ Boston, MA 02111-1307, USA. */ #define obstack_chunk_alloc xmalloc #define obstack_chunk_free free -#ifdef USG -#define vfork fork -#endif - #ifndef WIFSIGNALED #define WIFSIGNALED(S) (((S) & 0xff) != 0 && ((S) & 0xff) != 0x7f) #endif @@ -1716,13 +1725,7 @@ collect_execute (prog, argv, redir) #ifndef __CYGWIN32__ pid = vfork (); if (pid == -1) - { -#ifdef vfork - fatal_perror ("fork"); -#else - fatal_perror ("vfork"); -#endif - } + fatal_perror (VFORK_STRING); if (pid == 0) /* child context */ { @@ -2243,13 +2246,7 @@ scan_prog_file (prog_name, which_pass) /* Spawn child nm on pipe */ pid = vfork (); if (pid == -1) - { -#ifdef vfork - fatal_perror ("fork"); -#else - fatal_perror ("vfork"); -#endif - } + fatal_perror (VFORK_STRING); if (pid == 0) /* child context */ { @@ -2685,13 +2682,7 @@ scan_libraries (prog_name) /* Spawn child ldd on pipe */ pid = vfork (); if (pid == -1) - { -#ifdef vfork - fatal_perror ("fork"); -#else - fatal_perror ("vfork"); -#endif - } + fatal_perror (VFORK_STRING); if (pid == 0) /* child context */ { -- cgit v1.2.1