summaryrefslogtreecommitdiffstats
path: root/usr.bin/apply
diff options
context:
space:
mode:
authorkris <kris@FreeBSD.org>2000-05-19 09:42:53 +0000
committerkris <kris@FreeBSD.org>2000-05-19 09:42:53 +0000
commitb2022bf2c95bb5607e93b7eb49adb01615fc62b7 (patch)
tree365367ad9336e8d26e335996d040190f61d59391 /usr.bin/apply
parentdda5ed02c6b1a4756a71d2ff7e560e8a1895faa0 (diff)
downloadFreeBSD-src-b2022bf2c95bb5607e93b7eb49adb01615fc62b7.zip
FreeBSD-src-b2022bf2c95bb5607e93b7eb49adb01615fc62b7.tar.gz
fork() -> vfork()
This would have been commit #2 which was "Obtained from: BSD/OS" except their code is buggy (they call err() if the execl() fails, which will incorrectly call exit()), so instead this is: Obtained from: NetBSD
Diffstat (limited to 'usr.bin/apply')
-rw-r--r--usr.bin/apply/apply.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/apply/apply.c b/usr.bin/apply/apply.c
index fe060a0..978062f 100644
--- a/usr.bin/apply/apply.c
+++ b/usr.bin/apply/apply.c
@@ -210,13 +210,14 @@ system(command)
return(1);
omask = sigblock(sigmask(SIGCHLD));
- switch(pid = fork()) {
+ switch(pid = vfork()) {
case -1: /* error */
- err(1, "fork");
+ err(1, "vfork");
case 0: /* child */
(void)sigsetmask(omask);
execl(shell, name, "-c", command, NULL);
- err(1, "%s", shell);
+ warn("%s", shell);
+ _exit(1);
}
intsave = signal(SIGINT, SIG_IGN);
quitsave = signal(SIGQUIT, SIG_IGN);
OpenPOWER on IntegriCloud