aboutsummaryrefslogtreecommitdiff
path: root/lib/libnetgraph
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2007-08-03 18:33:43 +0000
committerAlexander Motin <mav@FreeBSD.org>2007-08-03 18:33:43 +0000
commit779544f2012f547d03b8b5d8205c1942be3a2da3 (patch)
tree9a6a3aa42766b8101c092b44ee1ee03d46f0bfca /lib/libnetgraph
parentf88db9ac2ffee27c1f96509acde271a8f58c2062 (diff)
Notes
Diffstat (limited to 'lib/libnetgraph')
-rw-r--r--lib/libnetgraph/internal.h2
-rw-r--r--lib/libnetgraph/msg.c12
2 files changed, 8 insertions, 6 deletions
diff --git a/lib/libnetgraph/internal.h b/lib/libnetgraph/internal.h
index 0c947e5eab6d..748ca7bb7571 100644
--- a/lib/libnetgraph/internal.h
+++ b/lib/libnetgraph/internal.h
@@ -44,7 +44,7 @@
#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
-#include <sys/select.h>
+#include <poll.h>
#include <sys/linker.h>
#include <stddef.h>
diff --git a/lib/libnetgraph/msg.c b/lib/libnetgraph/msg.c
index 8b4ca06a7166..534d1d181d48 100644
--- a/lib/libnetgraph/msg.c
+++ b/lib/libnetgraph/msg.c
@@ -42,6 +42,7 @@
__FBSDID("$FreeBSD$");
#include <sys/types.h>
+#include <sys/socket.h>
#include <stdarg.h>
#include <netgraph/ng_message.h>
#include <netgraph/ng_socket.h>
@@ -234,16 +235,17 @@ NgDeliverMsg(int cs, const char *path,
/* Wait for reply if there should be one. */
if (msg->header.cmd & NGM_HASREPLY) {
- fd_set rfds;
+ struct pollfd rfds;
int n;
- FD_ZERO(&rfds);
- FD_SET(cs, &rfds);
- n = select(cs + 1, &rfds, NULL, NULL, NULL);
+ rfds.fd = cs;
+ rfds.events = POLLIN;
+ rfds.revents = 0;
+ n = poll(&rfds, 1, INFTIM);
if (n == -1) {
errnosv = errno;
if (_gNgDebugLevel >= 1)
- NGLOG("select");
+ NGLOG("poll");
rtn = -1;
}
}