From f72a825a06f1c4ec88358de98508929785eeb22a Mon Sep 17 00:00:00 2001 From: Keith Bostic Date: Fri, 28 Apr 1995 23:15:38 -0800 Subject: [PATCH 1/1] Now that file descriptor limits are soft, and can be larger than FD_SETSIZE, using the value of getdtablesize() as an input to select() does not work. We fixed this in our RPC code a while back. Here's a patch to make window(1) work more correctly. From: Charles Hannum SCCS-vsn: usr.bin/window/wwinit.c 8.2 SCCS-vsn: usr.bin/window/wwopen.c 8.2 --- usr/src/usr.bin/window/wwinit.c | 4 ++-- usr/src/usr.bin/window/wwopen.c | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/usr/src/usr.bin/window/wwinit.c b/usr/src/usr.bin/window/wwinit.c index aad308b123..220f80fb12 100644 --- a/usr/src/usr.bin/window/wwinit.c +++ b/usr/src/usr.bin/window/wwinit.c @@ -9,7 +9,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)wwinit.c 8.1 (Berkeley) %G%"; +static char sccsid[] = "@(#)wwinit.c 8.2 (Berkeley) %G%"; #endif /* not lint */ #include "ww.h" @@ -24,7 +24,7 @@ wwinit() char *kp; int s; - wwdtablesize = getdtablesize(); + wwdtablesize = 3; wwhead.ww_forw = &wwhead; wwhead.ww_back = &wwhead; diff --git a/usr/src/usr.bin/window/wwopen.c b/usr/src/usr.bin/window/wwopen.c index 24ea422c5d..43182b00ab 100644 --- a/usr/src/usr.bin/window/wwopen.c +++ b/usr/src/usr.bin/window/wwopen.c @@ -9,7 +9,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)wwopen.c 8.1 (Berkeley) %G%"; +static char sccsid[] = "@(#)wwopen.c 8.2 (Berkeley) %G%"; #endif /* not lint */ #include "ww.h" @@ -90,6 +90,8 @@ wwopen(flags, nrow, ncol, row, col, nline) } w->ww_obe = w->ww_ob + 512; w->ww_obp = w->ww_obq = w->ww_ob; + if (w->ww_pty >= wwdtablesize) + wwdtablesize = w->ww_pty + 1; } w->ww_win = wwalloc(w->ww_w.t, w->ww_w.l, -- 2.20.1