From d1711d2af23d033aa68b258778c354aaaec1c75e Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Mon, 3 Nov 2014 22:14:55 +0000 Subject: select() to poll() conversions ok tedu (... other games maintainer absent) --- games/robots/move.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'games/robots/move.c') diff --git a/games/robots/move.c b/games/robots/move.c index c187d268ac4..558fbfb3cf2 100644 --- a/games/robots/move.c +++ b/games/robots/move.c @@ -1,4 +1,4 @@ -/* $OpenBSD: move.c,v 1.9 2009/10/27 23:59:26 deraadt Exp $ */ +/* $OpenBSD: move.c,v 1.10 2014/11/03 22:14:54 deraadt Exp $ */ /* $NetBSD: move.c,v 1.4 1995/04/22 10:08:58 cgd Exp $ */ /* @@ -90,8 +90,12 @@ get_move(void) else { over: if (Real_time) { - FD_SET(STDIN_FILENO, &rset); - retval = select(STDIN_FILENO + 1, &rset, NULL, NULL, &t); + struct pollfd pfd[1]; + + pfd[0].fd = STDIN_FILENO; + pfd[0].events = POLLIN; + retval = poll(pfd, 1, + t.tv_sec * 1000 + t.tv_usec / 1000); if (retval > 0) c = getchar(); else /* Don't move if timed out or error */ -- cgit v1.2.3