diff options
author | Paul Smith <psmith@gnu.org> | 2013-05-06 00:22:27 -0400 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2013-05-06 00:22:27 -0400 |
commit | 94735f0ad7f67c56afa1513381c73e8f62cd44fc (patch) | |
tree | fe07174cab4eba5d50ee5ad04684cfee6e454b08 | |
parent | 7c77486d1fbc820e6db97a5a11fabdc34dbdb729 (diff) | |
download | gunmake-94735f0ad7f67c56afa1513381c73e8f62cd44fc.tar.gz |
Remove use of vfork().
GCC was giving us warnings, most OS's now just run fork() when you call
vfork(), and looking at the standard definition of vfork() we are a long way
from using it safely anyway: you're not allowed to even call a function before
you exec().
-rw-r--r-- | config.ami.template | 6 | ||||
-rw-r--r-- | config.h-vms.template | 6 | ||||
-rw-r--r-- | config.h.W32.template | 18 | ||||
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | job.c | 9 | ||||
-rw-r--r-- | makeint.h | 4 | ||||
-rw-r--r-- | remote-cstms.c | 4 |
7 files changed, 6 insertions, 42 deletions
diff --git a/config.ami.template b/config.ami.template index 78e2e75..4202363 100644 --- a/config.ami.template +++ b/config.ami.template @@ -109,9 +109,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */ /* Define if utime(file, NULL) sets file's timestamp to the present. */ /* #undef HAVE_UTIME_NULL */ -/* Define if you have <vfork.h>. */ -/* #undef HAVE_VFORK_H */ - /* Define if you have the wait3 system call. */ /* #undef HAVE_WAIT3 */ @@ -176,9 +173,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */ instead of <sys/cpustats.h>. */ /* #undef UMAX4_3 */ -/* Define vfork as fork if vfork does not work. */ -/* #undef vfork */ - /* Name of this package (needed by automake) */ #define PACKAGE "%PACKAGE%" diff --git a/config.h-vms.template b/config.h-vms.template index dd1aa1e..7c3b1bd 100644 --- a/config.h-vms.template +++ b/config.h-vms.template @@ -138,9 +138,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */ /* Define to 1 if utime(file, NULL) sets file's timestamp to the present. */ /* #undef HAVE_UTIME_NULL */ -/* Define to 1 if you have <vfork.h>. */ -/* #undef HAVE_VFORK_H */ - /* Define to 1 if you have the wait3 system call. */ /* #undef HAVE_WAIT3 */ @@ -210,9 +207,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */ instead of <sys/cpustats.h>. */ /* #undef UMAX4_3 */ -/* Define vfork as fork if vfork does not work. */ -/* #undef vfork */ - /* Name of this package (needed by automake) */ #define PACKAGE "%PACKAGE%" diff --git a/config.h.W32.template b/config.h.W32.template index 82d83ad..1cd08d4 100644 --- a/config.h.W32.template +++ b/config.h.W32.template @@ -123,9 +123,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */ /* Define to 1 if you have the 'fileno' function. */ #define HAVE_FILENO 1 -/* Define to 1 if you have the 'fork' function. */ -/* #undef HAVE_FORK */ - /* Define to 1 if you have the 'getcwd' function. */ #define HAVE_GETCWD 1 @@ -339,24 +336,12 @@ this program. If not, see <http://www.gnu.org/licenses/>. */ #define HAVE_UNISTD_H 1 #endif -/* Define to 1 if you have the 'vfork' function. */ -/* #undef HAVE_VFORK */ - -/* Define to 1 if you have the <vfork.h> header file. */ -/* #undef HAVE_VFORK_H */ - /* Define to 1 if you have the 'wait3' function. */ /* #undef HAVE_WAIT3 */ /* Define to 1 if you have the 'waitpid' function. */ /* #undef HAVE_WAITPID */ -/* Define to 1 if 'fork' works. */ -/* #undef HAVE_WORKING_FORK */ - -/* Define to 1 if 'vfork' works. */ -/* #undef HAVE_WORKING_VFORK */ - /* Build host information. */ #define MAKE_HOST "Windows32" @@ -498,9 +483,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */ #define uintmax_t unsigned long #endif -/* Define as 'fork' if 'vfork' does not work. */ -/*#define vfork fork*/ - /* Define if you have <sys/wait.h> that is POSIX.1 compatible. */ /* #undef HAVE_SYS_WAIT_H */ diff --git a/configure.ac b/configure.ac index 45b201c..7b70f04 100644 --- a/configure.ac +++ b/configure.ac @@ -153,7 +153,6 @@ AC_CHECK_FUNCS([strcasecmp strncasecmp strcmpi strncmpi stricmp strnicmp]) AC_FUNC_STRCOLL AC_FUNC_ALLOCA -AC_FUNC_FORK([]) AC_FUNC_CLOSEDIR_VOID # See if the user wants to add (or not) GNU Guile support @@ -1380,9 +1380,8 @@ start_job_command (struct child *child) #endif int print_cmd; int sync_cmd; + int flags; char *p; - /* Must be volatile to silence bogus GCC warning about longjmp/vfork. */ - volatile int flags; #ifdef VMS char *argv; #else @@ -1677,7 +1676,7 @@ start_job_command (struct child *child) #ifdef VMS if (!child_execute_job (argv, child)) { /* Fork failed! */ - perror_with_name ("vfork", ""); + perror_with_name ("fork", ""); goto error; } @@ -1718,7 +1717,7 @@ start_job_command (struct child *child) #else /* !__EMX__ */ - child->pid = vfork (); + child->pid = fork (); environ = parent_environ; /* Restore value child may have clobbered. */ if (child->pid == 0) { @@ -1764,7 +1763,7 @@ start_job_command (struct child *child) { /* Fork failed! */ unblock_sigs (); - perror_with_name ("vfork", ""); + perror_with_name ("fork", ""); goto error; } # endif /* !__EMX__ */ @@ -492,10 +492,6 @@ typedef int (*load_func_t)(const gmk_floc *flocp); int load_file (const gmk_floc *flocp, const char **filename, int noerror, void **dlp); -#ifdef HAVE_VFORK_H -# include <vfork.h> -#endif - /* We omit these declarations on non-POSIX systems which define _POSIX_VERSION, because such systems often declare them in header files anyway. */ diff --git a/remote-cstms.c b/remote-cstms.c index 713b89a..1c4591b 100644 --- a/remote-cstms.c +++ b/remote-cstms.c @@ -221,11 +221,11 @@ start_remote_job (char **argv, char **envp, int stdin_fd, fflush (stdout); fflush (stderr); - pid = vfork (); + pid = fork (); if (pid < 0) { /* The fork failed! */ - perror_with_name ("vfork", ""); + perror_with_name ("fork", ""); return 1; } else if (pid == 0) |