aboutsummaryrefslogtreecommitdiff
path: root/libiberty
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>1998-11-02 07:24:47 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>1998-11-02 07:24:47 +0000
commitc5f7c4459e69cd56f51d92ad842a9652c94466e0 (patch)
treeebeeac360aa9e74086435dd1b4b79b026f8ef459 /libiberty
parentc375c43b73df248b6c1b7c87608ba491600c3e0a (diff)
downloadgcc-c5f7c4459e69cd56f51d92ad842a9652c94466e0.zip
gcc-c5f7c4459e69cd56f51d92ad842a9652c94466e0.tar.gz
gcc-c5f7c4459e69cd56f51d92ad842a9652c94466e0.tar.bz2
pexecute.c: Check HAVE_CONFIG_H, not IN_GCC, when determining whether to include config.h.
* pexecute.c: Check HAVE_CONFIG_H, not IN_GCC, when determining whether to include config.h. Possibly include unistd.h in the !IN_GCC case. Define VFORK_STRING as a printable function call 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. (pexecute): Set `errmsg_fmt' to VFORK_STRING instead of checking locally what string to use. From-SVN: r23499
Diffstat (limited to 'libiberty')
-rw-r--r--libiberty/ChangeLog11
-rw-r--r--libiberty/pexecute.c35
2 files changed, 31 insertions, 15 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index a6a4634..f2b5105 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,14 @@
+Mon Nov 2 10:22:01 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * pexecute.c: Check HAVE_CONFIG_H, not IN_GCC, when determining
+ whether to include config.h. Possibly include unistd.h in the
+ !IN_GCC case. Define VFORK_STRING as a printable function call
+ 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.
+ (pexecute): Set `errmsg_fmt' to VFORK_STRING instead of checking
+ locally what string to use.
+
1998-10-26 Mark Mitchell <mark@markmitchell.com>
* splay-tree.c: Tweak include directives to make sure declarations of
diff --git a/libiberty/pexecute.c b/libiberty/pexecute.c
index 1b0a374..b82f987 100644
--- a/libiberty/pexecute.c
+++ b/libiberty/pexecute.c
@@ -23,15 +23,33 @@ Boston, MA 02111-1307, USA. */
/* This file lives in at least two places: libiberty and gcc.
Don't change one without the other. */
-#ifdef IN_GCC
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif
+#ifdef IN_GCC
#include "system.h"
#else
#include <stdio.h>
#include <errno.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
#define ISSPACE (x) isspace(x)
#endif
+#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 <vfork.h>
+#endif
+#ifdef VMS
+#define vfork() (decc$$alloc_vfork_blocks() >= 0 ? \
+ lib$get_current_invo_context(decc$$get_vfork_jmpbuf()) : -1)
+#endif /* VMS */
+
#ifdef IN_GCC
#include "gansidecl.h"
/* ??? Need to find a suitable header file. */
@@ -628,15 +646,6 @@ pfinish ()
#if ! defined (__MSDOS__) && ! defined (OS2) && ! defined (MPW) \
&& ! defined (_WIN32)
-#ifdef VMS
-#define vfork() (decc$$alloc_vfork_blocks() >= 0 ? \
- lib$get_current_invo_context(decc$$get_vfork_jmpbuf()) : -1)
-#else
-#ifdef USG
-#define vfork fork
-#endif
-#endif
-
extern int execv ();
extern int execvp ();
#ifdef IN_GCC
@@ -703,11 +712,7 @@ pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
{
case -1:
{
-#ifdef vfork
- *errmsg_fmt = "fork";
-#else
- *errmsg_fmt = "vfork";
-#endif
+ *errmsg_fmt = VFORK_STRING;
*errmsg_arg = NULL;
return -1;
}