=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/telnet/sys_bsd.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- src/usr.bin/telnet/sys_bsd.c 2014/07/20 10:18:10 1.24 +++ src/usr.bin/telnet/sys_bsd.c 2014/07/20 10:55:26 1.25 @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_bsd.c,v 1.24 2014/07/20 10:18:10 guenther Exp $ */ +/* $OpenBSD: sys_bsd.c,v 1.25 2014/07/20 10:55:26 guenther Exp $ */ /* $NetBSD: sys_bsd.c,v 1.11 1996/02/28 21:04:10 thorpej Exp $ */ /* @@ -542,23 +542,6 @@ return 0; } - int -NetClose(fd) - int fd; -{ - return close(fd); -} - - - void -NetNonblockingIO(fd, onoff) - int fd; - int onoff; -{ - ioctl(fd, FIONBIO, (char *)&onoff); -} - - /* * Various signal handling routines. */ @@ -650,8 +633,12 @@ setconnmode(0); - NetNonblockingIO(net, 1); - + /* + * Mark the socket as non-blocking and receive urgent data inline. + * (The latter is required for correct telnet operation when a + * second urgent is sent before telnet can process the first.) + */ + ioctl(net, FIONBIO, &one); if (setsockopt(net, SOL_SOCKET, SO_OOBINLINE, &one, sizeof(one)) == -1) { perror("setsockopt"); }