[3236] in Release_Engineering
Bug in zwgc....
daemon@ATHENA.MIT.EDU (Theodore Ts'o)
Fri Jun 17 17:29:41 1994
Date: Fri, 17 Jun 94 17:29:33 EDT
From: tytso@MIT.EDU (Theodore Ts'o)
To: rel-eng@MIT.EDU
Cc: miki@MIT.EDU, vrt@MIT.EDU, cfields@MIT.EDU, wdc@MIT.EDU, probe@MIT.EDU
The following bugfix should be applied to zwgc, and then zwgc should be
recompiled for all platforms. Currently, when you run zwgc, it will be
polling its select loop instead of actually blocking; this adds 1 to the
load average on the machine, which is not a good thing. :-)
We should make sure this is fixed before the release goes out, since it
is rather visible. Thanks to Bill for pointing out this problem.
- Ted
P.S. I don't have convenient access to a zephyr build tree, so this
patch hasn't been tested, but I'm fairly confident it should work.
Basically, if have_tty is then the timval structure tv is set to 10
seconds; otherwise it was set to 0. Clearly whoever did the patch
assumed that would cause select to block; instead it caused select to
poll. The fix is to test if have_tty is NULL, and if it is, to pass in
a null pointer to select instead of the timeval structure.
*** mux.c.orig Fri Jun 17 16:06:47 1994
--- mux.c Fri Jun 17 16:31:12 1994
***************
*** 159,165 ****
input_sources_copy = input_sources;
i = select(max_source+1, &input_sources_copy, (fd_set *)0,
! (fd_set *)NULL, &tv);
if (i == -1) {
if (errno == EINTR)
--- 159,165 ----
input_sources_copy = input_sources;
i = select(max_source+1, &input_sources_copy, (fd_set *)0,
! (fd_set *)NULL, have_tty ? &tv : NULL);
if (i == -1) {
if (errno == EINTR)