vfork -> fork. The child calls execl() which calls malloc(), so

vfork() can't be used.  We could use alloca() in execl() so that
it can be called between vfork() and execve(), but a "portable"
popen() shouldn't depend on this.  Calling execle() instead of
execl() should be fairly safe, since execle() is supposed to be
callable from signal handlers and signal handlers can't call
malloc().  However, execle() is broken.
This commit is contained in:
Bruce Evans 1998-10-10 19:30:45 +00:00
parent da91462d5e
commit 0890dc6f44
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=40191

View file

@ -84,7 +84,7 @@ popen(command, type)
return (NULL);
}
switch (pid = vfork()) {
switch (pid = fork()) {
case -1: /* Error. */
(void)close(pdes[0]);
(void)close(pdes[1]);