aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/gen/popen.c
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>1998-10-10 19:30:45 +0000
committerBruce Evans <bde@FreeBSD.org>1998-10-10 19:30:45 +0000
commit0890dc6f446e4a9316b8360784052bb90e4be1c9 (patch)
treec44414fd45cc9dff8da53590dbf2ca2c5ab6a365 /lib/libc/gen/popen.c
parentda91462d5e0540c530c514766e2e43aad06ef431 (diff)
downloadsrc-0890dc6f446e4a9316b8360784052bb90e4be1c9.tar.gz
src-0890dc6f446e4a9316b8360784052bb90e4be1c9.zip
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.
Notes
Notes: svn path=/head/; revision=40191
Diffstat (limited to 'lib/libc/gen/popen.c')
-rw-r--r--lib/libc/gen/popen.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libc/gen/popen.c b/lib/libc/gen/popen.c
index 8cb79500b799..d7ea414b0820 100644
--- a/lib/libc/gen/popen.c
+++ b/lib/libc/gen/popen.c
@@ -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]);