freebsd-ports/net/omnitty/files/patch-main.c
Rong-En Fan 792dc31f14 - After SA 08:01.pty, openpty() calls fork and omnitty has a bad assumption
that library calls do not do that. Therefore, it's SIGCHLD handling causes
  a hang in wait() as openpty() already does that. Fix this by using waitpid()
  with WNOHANG.

Diagnosed by:	jhb
Tested by:	dhw (earlier version)
2008-02-20 02:06:11 +00:00

16 lines
449 B
C

--- main.c.orig 2005-10-26 06:08:25.000000000 +0800
+++ main.c 2008-02-17 22:45:29.000000000 +0800
@@ -335,9 +335,10 @@
while (!quit) {
if (zombie_count) {
- zombie_count--;
- chldpid = wait(NULL);
- machmgr_handle_death(chldpid);
+ if ((chldpid = waitpid(-1, NULL, WNOHANG)) > 0) {
+ zombie_count--;
+ machmgr_handle_death(chldpid);
+ }
}
machmgr_update();