diff options
| author | deraadt <deraadt@NetBSD.org> | 1994-03-27 07:49:10 +0000 |
|---|---|---|
| committer | deraadt <deraadt@NetBSD.org> | 1994-03-27 07:49:10 +0000 |
| commit | e91cd2af40de6705279ca8eaace0072e944f9fe2 (patch) | |
| tree | da44dbf36cf2fa291cdf5fb19a7ae2052e54f3d6 /lib/libc | |
| parent | ee7f97cad354e76702833407c80904ea19be8897 (diff) | |
but described in a posting by <RHussein@uh.edu> somewhere on the net.
select() loop hung if either socket was >=32.
Diffstat (limited to 'lib/libc')
| -rw-r--r-- | lib/libc/net/rcmd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/net/rcmd.c b/lib/libc/net/rcmd.c index c212c354f01..b958b2d7d63 100644 --- a/lib/libc/net/rcmd.c +++ b/lib/libc/net/rcmd.c @@ -33,7 +33,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)rcmd.c 5.24 (Berkeley) 2/24/91";*/ -static char *rcsid = "$Id: rcmd.c,v 1.4 1993/12/05 14:42:26 deraadt Exp $"; +static char *rcsid = "$Id: rcmd.c,v 1.5 1994/03/27 07:49:10 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -140,7 +140,7 @@ rcmd(ahost, rport, locuser, remuser, cmd, fd2p) FD_SET(s, &reads); FD_SET(s2, &reads); errno = 0; - if (select(32, &reads, 0, 0, 0) < 1 || + if (select( MAX(s, s2) + 1, &reads, 0, 0, 0) < 1 || !FD_ISSET(s2, &reads)) { if (errno != 0) perror("select: setting up stderr"); |
