diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2014-11-03 22:14:55 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2014-11-03 22:14:55 +0000 |
commit | d1711d2af23d033aa68b258778c354aaaec1c75e (patch) | |
tree | 6a81f08981c0c1bc216e1b0c68d2df2c7c555d45 /games/robots/move.c | |
parent | 1e8e39c1f489fa3e8e27b46744c1466b1dbba5d1 (diff) |
select() to poll() conversions
ok tedu (... other games maintainer absent)
Diffstat (limited to 'games/robots/move.c')
-rw-r--r-- | games/robots/move.c | 10 |
1 files changed, 7 insertions, 3 deletions
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 */ |