diff options
author | joerg <joerg@FreeBSD.org> | 1999-03-02 19:08:09 +0000 |
---|---|---|
committer | joerg <joerg@FreeBSD.org> | 1999-03-02 19:08:09 +0000 |
commit | 1288f941f795b1d583b25811de62109336d75b26 (patch) | |
tree | 3015fa43a3c326ec194d5d0bd8223916caf39a62 /usr.bin/window/wwspawn.c | |
parent | c58977479e272849c1164815ed8e7706b6a47a6f (diff) | |
download | FreeBSD-src-1288f941f795b1d583b25811de62109336d75b26.zip FreeBSD-src-1288f941f795b1d583b25811de62109336d75b26.tar.gz |
Make window(1) actually work again. It has been broken for quite some
time now.
For whatever reason, the kernel seems to have generated SIGIOs
previously without an initial fcntl(...,F_SETOWN), but does no longer.
This caused window(1) to wait indefinitely for input.
Also, undo rev 1.3 of wwspawn.c, it was not well-thought, and
apparently not even tested at all. The blindly (even in a nonsensical
place like the comment on top of the function) applied replacement of
vfork() by fork() totally ignored that window(1) *does* abuse the
feature of vfork() where a modification of the parent's address space
is possible (in this case, to notify the parent of an erred exec*).
Also, with vfork(), it is guaranteed that the parent is only woken up
after the exec*() happened, where the replacement by fork() made the
parent to almost always become runnable again before the child, in
which case the parent simply told `subprocess died'. Unfortunately,
working around _this_ seems to be a lot more of redesign work compared
to little gained value, so i think relying on the specifics of vfork()
is the simpler way.
Submitted by: Philipp Mergenthaler <un1i@rz.uni-karlsruhe.de>
Diffstat (limited to 'usr.bin/window/wwspawn.c')
-rw-r--r-- | usr.bin/window/wwspawn.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/window/wwspawn.c b/usr.bin/window/wwspawn.c index 3588dd8..57e2f66 100644 --- a/usr.bin/window/wwspawn.c +++ b/usr.bin/window/wwspawn.c @@ -42,7 +42,7 @@ static char sccsid[] = "@(#)wwspawn.c 8.1 (Berkeley) 6/6/93"; #include <signal.h> /* - * There is a dead lock with fork and closing of pseudo-ports. + * There is a dead lock with vfork and closing of pseudo-ports. * So we have to be sneaky about error reporting. */ wwspawn(wp, file, argv) @@ -56,7 +56,7 @@ char **argv; int s; s = sigblock(sigmask(SIGCHLD)); - switch (pid = fork()) { + switch (pid = vfork()) { case -1: wwerrno = WWE_SYS; ret = -1; |