From d2b90f312d93fe073c189388ee62379c95292838 Mon Sep 17 00:00:00 2001 From: guenther Date: Sun, 20 Jul 2014 09:20:48 +0000 Subject: [PATCH] Delete an insane chunk of code for handling broken poll() emulation. Pass poll() INFTIM instead of -1 --- usr.bin/telnet/sys_bsd.c | 17 ++--------------- usr.bin/telnet/utilities.c | 6 +++--- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/usr.bin/telnet/sys_bsd.c b/usr.bin/telnet/sys_bsd.c index 5ab638771ef..371f0d7f9a2 100644 --- a/usr.bin/telnet/sys_bsd.c +++ b/usr.bin/telnet/sys_bsd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_bsd.c,v 1.20 2014/07/20 08:12:46 guenther Exp $ */ +/* $OpenBSD: sys_bsd.c,v 1.21 2014/07/20 09:20:48 guenther Exp $ */ /* $NetBSD: sys_bsd.c,v 1.11 1996/02/28 21:04:10 thorpej Exp $ */ /* @@ -726,20 +726,7 @@ process_rings(netin, netout, netex, ttyin, ttyout, dopoll) pfd[TELNET_FD_NET].fd = -1; } - if ((c = poll(pfd, TELNET_FD_NUM, dopoll ? 0 : -1)) < 0) { - if (c == -1) { - /* - * we can get EINTR if we are in line mode, - * and the user does an escape (TSTP), or - * some other signal generator. - */ - if (errno == EINTR) { - return 0; - } - /* I don't like this, does it ever happen? */ - printf("sleep(5) from telnet, after poll\r\n"); - sleep(5); - } + if ((c = poll(pfd, TELNET_FD_NUM, dopoll ? 0 : INFTIM)) < 0) { return 0; } diff --git a/usr.bin/telnet/utilities.c b/usr.bin/telnet/utilities.c index f1ccb70bfaa..1785f17a6e3 100644 --- a/usr.bin/telnet/utilities.c +++ b/usr.bin/telnet/utilities.c @@ -1,4 +1,4 @@ -/* $OpenBSD: utilities.c,v 1.17 2014/07/20 08:56:47 guenther Exp $ */ +/* $OpenBSD: utilities.c,v 1.18 2014/07/20 09:20:48 guenther Exp $ */ /* $NetBSD: utilities.c,v 1.5 1996/02/28 21:04:21 thorpej Exp $ */ /* @@ -667,11 +667,11 @@ EmptyTerminal() pfd[0].events = POLLOUT; if (TTYBYTES() == 0) { - (void) poll(pfd, 1, -1); /* wait for TTLOWAT */ + (void) poll(pfd, 1, INFTIM); /* wait for TTLOWAT */ } else { while (TTYBYTES()) { (void) ttyflush(0); - (void) poll(pfd, 1, -1); /* wait for TTLOWAT */ + (void) poll(pfd, 1, INFTIM); /* wait for TTLOWAT */ } } } -- 2.20.1