From ec8d5bfb7ad8ef4a717e8abdd7f832c2c221d233 Mon Sep 17 00:00:00 2001 From: Edward Wang Date: Sat, 27 Aug 1983 00:19:43 -0800 Subject: [PATCH] bug with wwforce hanging SCCS-vsn: usr.bin/window/wwiomux.c 3.3 SCCS-vsn: usr.bin/window/main.c 3.8 SCCS-vsn: usr.bin/window/wwgets.c 3.2 --- usr/src/usr.bin/window/main.c | 7 +++---- usr/src/usr.bin/window/wwgets.c | 7 +++---- usr/src/usr.bin/window/wwiomux.c | 8 ++++---- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/usr/src/usr.bin/window/main.c b/usr/src/usr.bin/window/main.c index 25bbd75741..8087fe8384 100644 --- a/usr/src/usr.bin/window/main.c +++ b/usr/src/usr.bin/window/main.c @@ -1,5 +1,5 @@ #ifndef lint -static char *sccsid = "@(#)main.c 3.7 83/08/26"; +static char *sccsid = "@(#)main.c 3.8 83/08/26"; #endif #include "defs.h" @@ -122,10 +122,9 @@ char **argv; wwcurtowin(curwin); wwupdate(); wwflush(); - imask = 1 << 0; - while (wwforce(&imask) < 0) + while (imask = 1, wwforce(&imask) < 0) ; - if ((imask & 1 << 0) == 0) + if ((imask & 1) == 0) continue; /* NOTE: ibufc == 0 */ ibufp = ibuf; diff --git a/usr/src/usr.bin/window/wwgets.c b/usr/src/usr.bin/window/wwgets.c index b80c28535e..8478f8ac69 100644 --- a/usr/src/usr.bin/window/wwgets.c +++ b/usr/src/usr.bin/window/wwgets.c @@ -1,5 +1,5 @@ #ifndef lint -static char *sccsid = "@(#)wwgets.c 3.1 83/08/11"; +static char *sccsid = "@(#)wwgets.c 3.2 83/08/26"; #endif #include "defs.h" @@ -15,10 +15,9 @@ bread() while (ibufc == 0) { wwupdate(); wwflush(); - imask = 1 << 0; - while (wwforce(&imask) < 0) + while (imask = 1, wwforce(&imask) < 0) ; - if ((imask & 1 << 0) == 0) + if ((imask & 1) == 0) continue; if (ibufc == 0) { p = ibufp = ibuf; diff --git a/usr/src/usr.bin/window/wwiomux.c b/usr/src/usr.bin/window/wwiomux.c index 258333e4cb..73355aea4b 100644 --- a/usr/src/usr.bin/window/wwiomux.c +++ b/usr/src/usr.bin/window/wwiomux.c @@ -1,5 +1,5 @@ #ifndef lint -static char *sccsid = "@(#)wwiomux.c 3.2 83/08/26"; +static char *sccsid = "@(#)wwiomux.c 3.3 83/08/26"; #endif #include "ww.h" @@ -14,12 +14,12 @@ register int *imask; for (w = wwindex; w < &wwindex[NWW]; w++) if (*w && (*w)->ww_haspty && (*w)->ww_pty >= 0) *imask |= 1 << (*w)->ww_pty; + if (*imask == 0) + return -1; n = select(wwdtablesize, imask, (int *)0, (int *)0, (struct timeval *)0); - if (n <= 0) { - wwerrno = WWE_SYS; + if (n <= 0) return -1; - } for (w = wwindex; w < &wwindex[NWW]; w++) if (*w && (*w)->ww_haspty && (*w)->ww_pty >= 0 && *imask & 1 << (*w)->ww_pty) { -- 2.20.1