summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>1998-10-13 14:52:33 +0000
committerdes <des@FreeBSD.org>1998-10-13 14:52:33 +0000
commit3ca80efd3ae02267b3cd6ee92f92c592e3892a1e (patch)
tree47aae64b409356a4bf073cd33de8d06645f2ff88 /usr.bin
parent528a0157d45bb4f11b9858153bbea5ecb7dafd3a (diff)
downloadFreeBSD-src-3ca80efd3ae02267b3cd6ee92f92c592e3892a1e.zip
FreeBSD-src-3ca80efd3ae02267b3cd6ee92f92c592e3892a1e.tar.gz
Calls one or more of malloc(), warn(), err(), syslog(), execlp() or
execvp() in the child branch of a vfork(). Changed to use fork() instead. Some of these (mv, find, apply, xargs) might benefit greatly from being rewritten to use vfork() properly. PR: Loosely related to bin/8252 Approved by: jkh and bde
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/apply/apply.c2
-rw-r--r--usr.bin/find/function.c4
-rw-r--r--usr.bin/newkey/update.c6
-rw-r--r--usr.bin/time/time.c4
-rw-r--r--usr.bin/tn3270/sys_curses/system.c4
-rw-r--r--usr.bin/truss/setup.c8
-rw-r--r--usr.bin/vacation/vacation.c4
-rw-r--r--usr.bin/xargs/xargs.c6
-rw-r--r--usr.bin/xinstall/xinstall.c4
9 files changed, 19 insertions, 23 deletions
diff --git a/usr.bin/apply/apply.c b/usr.bin/apply/apply.c
index 78e9062..37a77b7 100644
--- a/usr.bin/apply/apply.c
+++ b/usr.bin/apply/apply.c
@@ -207,7 +207,7 @@ system(command)
return(1);
omask = sigblock(sigmask(SIGCHLD));
- switch(pid = vfork()) {
+ switch(pid = fork()) {
case -1: /* error */
err(1, "fork");
case 0: /* child */
diff --git a/usr.bin/find/function.c b/usr.bin/find/function.c
index 1810296..1ffdd52 100644
--- a/usr.bin/find/function.c
+++ b/usr.bin/find/function.c
@@ -308,7 +308,7 @@ f_exec(plan, entry)
/* make sure find output is interspersed correctly with subprocesses */
fflush(stdout);
- switch (pid = vfork()) {
+ switch (pid = fork()) {
case -1:
err(1, "fork");
/* NOTREACHED */
@@ -414,7 +414,7 @@ f_execdir(plan, entry)
fflush(stdout);
fflush(stderr);
- switch (pid = vfork()) {
+ switch (pid = fork()) {
case -1:
err(1, "fork");
/* NOTREACHED */
diff --git a/usr.bin/newkey/update.c b/usr.bin/newkey/update.c
index 1c33bcb..609977a 100644
--- a/usr.bin/newkey/update.c
+++ b/usr.bin/newkey/update.c
@@ -32,7 +32,7 @@
static char sccsid[] = "@(#)update.c 1.2 91/03/11 Copyr 1986 Sun Micro";
#endif
static const char rcsid[] =
- "$Id: update.c,v 1.2 1997/07/29 06:54:16 charnier Exp $";
+ "$Id: update.c,v 1.3 1998/02/20 04:38:20 jb Exp $";
#endif
/*
@@ -167,11 +167,7 @@ _openchild(command, fto, ffrom)
if (pipe(pdfrom) < 0) {
goto error2;
}
-#ifdef VFORK
- switch (pid = vfork()) {
-#else
switch (pid = fork()) {
-#endif
case -1:
goto error3;
diff --git a/usr.bin/time/time.c b/usr.bin/time/time.c
index f74b6db..8d3d8a0 100644
--- a/usr.bin/time/time.c
+++ b/usr.bin/time/time.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)time.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id: time.c,v 1.10 1998/07/28 10:08:16 des Exp $";
+ "$Id: time.c,v 1.11 1998/08/24 10:16:59 cracauer Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -106,7 +106,7 @@ main(argc, argv)
}
gettimeofday(&before, (struct timezone *)NULL);
- switch(pid = vfork()) {
+ switch(pid = fork()) {
case -1: /* error */
err(1, "time");
/* NOTREACHED */
diff --git a/usr.bin/tn3270/sys_curses/system.c b/usr.bin/tn3270/sys_curses/system.c
index 67b31af..68a8e5f 100644
--- a/usr.bin/tn3270/sys_curses/system.c
+++ b/usr.bin/tn3270/sys_curses/system.c
@@ -722,9 +722,9 @@ char *argv[];
child_died(); /* Start up signal handler */
shell_active = 1; /* We are running down below */
- if (shell_pid = vfork()) {
+ if (shell_pid = fork()) {
if (shell_pid == -1) {
- perror("vfork");
+ perror("fork");
(void) close(serversock);
} else {
state = UNCONNECTED;
diff --git a/usr.bin/truss/setup.c b/usr.bin/truss/setup.c
index 9d0abf2..fbef7e1 100644
--- a/usr.bin/truss/setup.c
+++ b/usr.bin/truss/setup.c
@@ -31,7 +31,7 @@
#ifndef lint
static const char rcsid[] =
- "$Id$";
+ "$Id: setup.c,v 1.7 1998/01/05 07:30:25 charnier Exp $";
#endif /* not lint */
/*
@@ -56,7 +56,7 @@ static int evflags = 0;
/*
* setup_and_wait() is called to start a process. All it really does
- * is vfork(), set itself up to stop on exec or exit, and then exec
+ * is fork(), set itself up to stop on exec or exit, and then exec
* the given command. At that point, the child process stops, and
* the parent can wake up and deal with it.
*/
@@ -69,9 +69,9 @@ setup_and_wait(char *command[]) {
int pid;
int flags;
- pid = vfork();
+ pid = fork();
if (pid == -1) {
- err(1, "vfork failed");
+ err(1, "fork failed");
}
if (pid == 0) { /* Child */
int mask = S_EXEC | S_EXIT;
diff --git a/usr.bin/vacation/vacation.c b/usr.bin/vacation/vacation.c
index 6ea8c28..8790163 100644
--- a/usr.bin/vacation/vacation.c
+++ b/usr.bin/vacation/vacation.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)from: vacation.c 8.2 (Berkeley) 1/26/94";
#endif
static const char rcsid[] =
- "$Id$";
+ "$Id: vacation.c,v 1.12 1997/11/03 07:51:05 charnier Exp $";
#endif /* not lint */
/*
@@ -417,7 +417,7 @@ sendmessage(myname)
syslog(LOG_ERR, "vacation: pipe: %s", strerror(errno));
exit(1);
}
- i = vfork();
+ i = fork();
if (i < 0) {
syslog(LOG_ERR, "vacation: fork: %s", strerror(errno));
exit(1);
diff --git a/usr.bin/xargs/xargs.c b/usr.bin/xargs/xargs.c
index d5cf527..ec7eea3 100644
--- a/usr.bin/xargs/xargs.c
+++ b/usr.bin/xargs/xargs.c
@@ -45,7 +45,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)xargs.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id: xargs.c,v 1.5 1997/08/27 06:26:23 charnier Exp $";
+ "$Id: xargs.c,v 1.6 1998/06/17 12:58:43 jkoshy Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -287,9 +287,9 @@ run(argv)
(void)fflush(stderr);
}
noinvoke = 0;
- switch(pid = vfork()) {
+ switch(pid = fork()) {
case -1:
- err(1, "vfork");
+ err(1, "fork");
case 0:
execvp(argv[0], argv);
warn("%s", argv[0]);
diff --git a/usr.bin/xinstall/xinstall.c b/usr.bin/xinstall/xinstall.c
index 61adb5d..f6bc52c 100644
--- a/usr.bin/xinstall/xinstall.c
+++ b/usr.bin/xinstall/xinstall.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "From: @(#)xinstall.c 8.1 (Berkeley) 7/21/93";
#endif
static const char rcsid[] =
- "$Id: xinstall.c,v 1.31 1998/01/20 13:52:32 bde Exp $";
+ "$Id: xinstall.c,v 1.32 1998/06/02 12:00:07 peter Exp $";
#endif /* not lint */
/*-
@@ -645,7 +645,7 @@ strip(to_name)
{
int serrno, status;
- switch (vfork()) {
+ switch (fork()) {
case -1:
serrno = errno;
(void)unlink(to_name);
OpenPOWER on IntegriCloud