summaryrefslogtreecommitdiff
path: root/usr.sbin/mrinfo/mrinfo.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-08-19 19:09:46 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-08-19 19:09:46 +0000
commite7bfb4baef8ce89dfda2c841d38b8333e6870bb3 (patch)
treeaf96b8a608041e19ceb5e6df154342c1f3b7128c /usr.sbin/mrinfo/mrinfo.c
parentdf97df23b01674de4527b9c8fb7ad993fc157a45 (diff)
convert to poll; ok dhartmei
Diffstat (limited to 'usr.sbin/mrinfo/mrinfo.c')
-rw-r--r--usr.sbin/mrinfo/mrinfo.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/usr.sbin/mrinfo/mrinfo.c b/usr.sbin/mrinfo/mrinfo.c
index 89a861f5cfe..b528415b637 100644
--- a/usr.sbin/mrinfo/mrinfo.c
+++ b/usr.sbin/mrinfo/mrinfo.c
@@ -76,7 +76,7 @@
#ifndef lint
static char rcsid[] =
- "@(#) $OpenBSD: mrinfo.c,v 1.16 2003/06/11 23:33:28 deraadt Exp $";
+ "@(#) $OpenBSD: mrinfo.c,v 1.17 2003/08/19 19:09:45 deraadt Exp $";
/* original rcsid:
"@(#) Header: mrinfo.c,v 1.6 93/04/08 15:14:16 van Exp (LBL)";
*/
@@ -88,6 +88,7 @@ static char rcsid[] =
#include "defs.h"
#include <arpa/inet.h>
#include <stdarg.h>
+#include <poll.h>
#include <err.h>
#define DEFAULT_TIMEOUT 4 /* How long to wait before retrying requests */
@@ -419,12 +420,10 @@ main(int argc, char *argv[])
socklen_t dummy = 0;
struct igmp *igmp;
struct ip *ip;
- fd_set fds;
+ struct pollfd pfd[1];
- FD_ZERO(&fds);
- if (igmp_socket >= FD_SETSIZE)
- log(LOG_ERR, 0, "descriptor too big");
- FD_SET(igmp_socket, &fds);
+ pfd[0].fd = igmp_socket;
+ pfd[0].events = POLLIN;
gettimeofday(&now, 0);
tv.tv_sec = et.tv_sec - now.tv_sec;
@@ -437,7 +436,7 @@ main(int argc, char *argv[])
if (tv.tv_sec < 0)
tv.tv_sec = tv.tv_usec = 0;
- count = select(igmp_socket + 1, &fds, 0, 0, &tv);
+ count = poll(pfd, 1, tv.tv_sec * 1000);
if (count < 0) {
if (errno != EINTR)