summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorJiri Pirko <jiri@resnulli.us>2013-03-29 17:02:38 +0100
committerJiri Pirko <jiri@resnulli.us>2013-03-29 17:05:32 +0100
commitca3dae8b39c6fdd6fced4fb3f828342e781fcdcf (patch)
tree9374f9a40d28bb565b1e2fc29d84e7485d028ae4 /utils
parent94ac6837a35b2a4aaf30f01fb919fc90ee88ac1e (diff)
downloadlibndp-ca3dae8b39c6fdd6fced4fb3f828342e781fcdcf.tar.gz
libndp: remove unnecessary evenfd struct and handle all by single event fd
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Diffstat (limited to 'utils')
-rw-r--r--utils/ndptool.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/utils/ndptool.c b/utils/ndptool.c
index 904a627..dddb402 100644
--- a/utils/ndptool.c
+++ b/utils/ndptool.c
@@ -57,9 +57,9 @@ static int run_main_loop(struct ndp *ndp)
fd_set rfds_tmp;
int fdmax;
int ret;
- struct ndp_eventfd *eventfd;
sigset_t mask;
int sfd;
+ int ndp_fd;
int err = 0;
sigemptyset(&mask);
@@ -82,13 +82,10 @@ static int run_main_loop(struct ndp *ndp)
FD_SET(sfd, &rfds);
fdmax = sfd;
- ndp_for_each_event_fd(eventfd, ndp) {
- int fd = ndp_get_eventfd_fd(ndp, eventfd);
-
- FD_SET(fd, &rfds);
- if (fd > fdmax)
- fdmax = fd;
- }
+ ndp_fd = ndp_get_eventfd(ndp);
+ FD_SET(ndp_fd, &rfds);
+ if (ndp_fd > fdmax)
+ fdmax = ndp_fd;
fdmax++;
for (;;) {
@@ -121,13 +118,12 @@ static int run_main_loop(struct ndp *ndp)
}
}
- ndp_for_each_event_fd(eventfd, ndp) {
- if (FD_ISSET(ndp_get_eventfd_fd(ndp, eventfd), &rfds_tmp))
- err = ndp_call_eventfd_handler(ndp, eventfd);
- if (err) {
- pr_err("ndp eventfd handler call failed\n");
- return err;
- }
+ if (FD_ISSET(ndp_fd, &rfds_tmp)) {
+ err = ndp_call_eventfd_handler(ndp);
+ if (err) {
+ pr_err("ndp eventfd handler call failed\n");
+ return err;
+ }
}
}
out: