]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Add check for vfork() to configure.in. Cleanup uses.
authorAndrew Cagney <cagney@redhat.com>
Sat, 2 Dec 2000 15:40:56 +0000 (15:40 +0000)
committerAndrew Cagney <cagney@redhat.com>
Sat, 2 Dec 2000 15:40:56 +0000 (15:40 +0000)
gdb/ChangeLog
gdb/config.in
gdb/configure
gdb/configure.in
gdb/fork-child.c
gdb/ser-pipe.c

index 250b3273759a8e71c824e7a1b49b69530809ee06..6e05b5e017a1dc38317d01a8d46c31a1cc3224c0 100644 (file)
@@ -1,3 +1,12 @@
+Sun Dec  3 02:28:26 2000  Andrew Cagney  <cagney@b1.cygnus.com>
+
+       * ser-pipe.c (pipe_open): Only use vfork when available.
+       * fork-child.c (fork_inferior): Fix #ifdef HAVE_VFORK test.
+       (clone_and_follow_inferior): Ditto.
+
+       * configure.in (AC_CHECK_FUNCS): Check for vfork.
+       * configure, config.in: Regenerate.
+
 Sun Dec  3 01:54:49 2000  Andrew Cagney  <cagney@b1.cygnus.com>
 
        * ser-unix.c (wait_for): Initialize the FD_SET before every select
index bfb15cd3ef911fa6ad8818b59b9e00d470bf597c..f6f00318b8aa255ff821bd9b676fccfc630d541b 100644 (file)
 /* Define if you have the strchr function.  */
 #undef HAVE_STRCHR
 
+/* Define if you have the vfork function.  */
+#undef HAVE_VFORK
+
 /* Define if you have the <argz.h> header file.  */
 #undef HAVE_ARGZ_H
 
index f02de34d38b9cc3dc254170e94967d40737a23dc..6786629c79e5234366d49eb47a77e0b7ba50b062 100755 (executable)
@@ -3557,7 +3557,7 @@ EOF
 fi
 
 
-for ac_func in setpgid sbrk sigaction isascii bzero bcopy btowc poll sigprocmask
+for ac_func in setpgid sbrk sigaction isascii bzero bcopy btowc poll sigprocmask vfork
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
 echo "configure:3564: checking for $ac_func" >&5
index 2b14ac308c6ec2dc41d42a9854911e783546564f..eb5a11f95bb29ea8dcd2f7052c9b8e80e55e56e0 100644 (file)
@@ -129,7 +129,7 @@ AC_HEADER_STAT
 
 AC_C_CONST
 
-AC_CHECK_FUNCS(setpgid sbrk sigaction isascii bzero bcopy btowc poll sigprocmask)
+AC_CHECK_FUNCS(setpgid sbrk sigaction isascii bzero bcopy btowc poll sigprocmask vfork)
 AC_FUNC_ALLOCA
 
 # See if machine/reg.h supports the %fs and %gs i386 segment registers.
index 147a59fd7728e3f61dfd55e4ab463e61c8cf67f0..e97f451bcec380b3b9fc6926c9beeeeadc3b417a 100644 (file)
@@ -244,13 +244,13 @@ fork_inferior (char *exec_file, char *allargs, char **env,
   if (pre_trace_fun != NULL)
     (*pre_trace_fun) ();
 
-#if defined(USG) && !defined(HAVE_VFORK)
-  pid = fork ();
-#else
+#ifdef HAVE_VFORK
   if (debug_fork)
     pid = fork ();
   else
     pid = vfork ();
+#else
+  pid = fork ();
 #endif
 
   if (pid < 0)
@@ -416,13 +416,13 @@ clone_and_follow_inferior (int child_pid, int *followed_child)
     error ("error getting pipe for handoff semaphore");
 
   /* Clone the debugger. */
-#if defined(USG) && !defined(HAVE_VFORK)
-  debugger_pid = fork ();
-#else
+#ifdef HAVE_VFORK
   if (debug_fork)
     debugger_pid = fork ();
   else
     debugger_pid = vfork ();
+#else
+  debugger_pid = fork ();
 #endif
 
   if (debugger_pid < 0)
index a510bff8da397d15a9db315a25fbb0dde2085aed..fd073c2e0a58324364ac5d10bf4a229114a85b0a 100644 (file)
@@ -64,7 +64,11 @@ pipe_open (serial_t scb, const char *name)
   if (socketpair (AF_UNIX, SOCK_STREAM, 0, pdes) < 0)
     return -1;
 
+#ifdef HAVE_VFORK
   pid = vfork ();
+#else
+  pid = fork ();
+#endif
   
   /* Error. */
   if (pid == -1)