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
This commit is contained in:
Kris Kennaway 2000-05-19 09:42:53 +00:00
parent 9ece4dbfe9
commit 6ad135868c

View File

@ -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);