summaryrefslogtreecommitdiffstats
path: root/usr.sbin/mrinfo
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2003-08-19 19:08:01 +0000
committerderaadt <deraadt@openbsd.org>2003-08-19 19:08:01 +0000
commit6791a8ace7a734ea15fe071a392df0f71dfec0f9 (patch)
tree5b4f73005aee2720ed4e35cd66e8aec9bc755758 /usr.sbin/mrinfo
parentnumber of mbuf clusters is not the same as number of pages allocated for 'em; noticed by dsb@uvm.poi.dvo.ru (diff)
downloadwireguard-openbsd-6791a8ace7a734ea15fe071a392df0f71dfec0f9.tar.xz
wireguard-openbsd-6791a8ace7a734ea15fe071a392df0f71dfec0f9.zip
convert to poll; ok dhartmei
Diffstat (limited to 'usr.sbin/mrinfo')
-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)