From 63455a9be5cedd59d73ce206ddf3f6c20c8a7be3 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 9 Apr 2007 15:34:49 +0200 Subject: [PATCH] [MINOR] use 'is_set' instead of 'isset' in struct poller 'isset' was defined as a macro in /usr/include/sys/param.h, and it breaks build on at least OpenBSD. --- include/proto/fd.h | 2 +- include/types/fd.h | 4 ++-- src/ev_epoll.c | 4 ++-- src/ev_kqueue.c | 4 ++-- src/ev_poll.c | 4 ++-- src/ev_select.c | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/proto/fd.h b/include/proto/fd.h index be5261248..9b4c63279 100644 --- a/include/proto/fd.h +++ b/include/proto/fd.h @@ -53,7 +53,7 @@ void run_poller(); #define EV_FD_SET(fd, ev) (cur_poller.set((fd), (ev))) #define EV_FD_CLR(fd, ev) (cur_poller.clr((fd), (ev))) -#define EV_FD_ISSET(fd, ev) (cur_poller.isset((fd), (ev))) +#define EV_FD_ISSET(fd, ev) (cur_poller.is_set((fd), (ev))) #define EV_FD_COND_S(fd, ev) (cur_poller.cond_s((fd), (ev))) #define EV_FD_COND_C(fd, ev) (cur_poller.cond_c((fd), (ev))) #define EV_FD_REM(fd) (cur_poller.rem(fd)) diff --git a/include/types/fd.h b/include/types/fd.h index 2128cb9b2..68335c033 100644 --- a/include/types/fd.h +++ b/include/types/fd.h @@ -2,7 +2,7 @@ include/types/fd.h File descriptors states. - Copyright (C) 2000-2006 Willy Tarreau - w@1wt.eu + Copyright (C) 2000-2007 Willy Tarreau - w@1wt.eu This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -73,7 +73,7 @@ struct fdtab { */ struct poller { void *private; /* any private data for the poller */ - REGPRM2 int (*isset)(const int fd, int dir); /* check if is being polled for dir */ + REGPRM2 int (*is_set)(const int fd, int dir); /* check if is being polled for dir */ REGPRM2 int (*set)(const int fd, int dir); /* set polling on for */ REGPRM2 int (*clr)(const int fd, int dir); /* clear polling on for */ REGPRM2 int (*cond_s)(const int fd, int dir); /* set polling on for if unset */ diff --git a/src/ev_epoll.c b/src/ev_epoll.c index 482ddc06d..6931a0c5d 100644 --- a/src/ev_epoll.c +++ b/src/ev_epoll.c @@ -49,7 +49,7 @@ static int epoll_fd; * instead of the usual macros improve the FD_* performance by about 80%, * and that marking them regparm(2) adds another 20%. */ -REGPRM2 static int __fd_isset(const int fd, int dir) +REGPRM2 static int __fd_is_set(const int fd, int dir) { return FD_ISSET(fd, fd_evts[dir]); } @@ -308,7 +308,7 @@ int epoll_register(struct poller *p) p->init = epoll_init; p->term = epoll_term; p->poll = epoll_poll; - p->isset = __fd_isset; + p->is_set = __fd_is_set; p->set = __fd_set; p->clr = __fd_clr; p->rem = __fd_rem; diff --git a/src/ev_kqueue.c b/src/ev_kqueue.c index b3510f3a5..39845884c 100644 --- a/src/ev_kqueue.c +++ b/src/ev_kqueue.c @@ -54,7 +54,7 @@ REGPRM3 static int kqev_del(struct kevent *kev, const int fd, const int dir) /* * Returns non-zero if direction is already set for . */ -REGPRM2 static int __fd_isset(const int fd, int dir) +REGPRM2 static int __fd_is_set(const int fd, int dir) { return FD_ISSET(fd, fd_evts[dir]); } @@ -220,7 +220,7 @@ int kqueue_register(struct poller *p) p->term = kqueue_term; p->poll = kqueue_poll; - p->isset = __fd_isset; + p->is_set = __fd_is_set; p->cond_s = p->set = __fd_set; p->cond_c = p->clr = __fd_clr; p->clo = p->rem = __fd_rem; diff --git a/src/ev_poll.c b/src/ev_poll.c index 235772d13..06adeb42d 100644 --- a/src/ev_poll.c +++ b/src/ev_poll.c @@ -37,7 +37,7 @@ static struct pollfd *poll_events = NULL; * instead of the usual macros improve the FD_* performance by about 80%, * and that marking them regparm(2) adds another 20%. */ -REGPRM2 static int __fd_isset(const int fd, int dir) +REGPRM2 static int __fd_is_set(const int fd, int dir) { return FD_ISSET(fd, fd_evts[dir]); } @@ -216,7 +216,7 @@ int poll_register(struct poller *p) p->init = poll_init; p->term = poll_term; p->poll = poll_poll; - p->isset = __fd_isset; + p->is_set = __fd_is_set; p->set = __fd_set; p->clr = __fd_clr; p->clo = p->rem = __fd_rem; diff --git a/src/ev_select.c b/src/ev_select.c index dc43b5e35..c5dbedf25 100644 --- a/src/ev_select.c +++ b/src/ev_select.c @@ -34,7 +34,7 @@ static fd_set *tmp_evts[2]; * instead of the usual macros improve the FD_* performance by about 80%, * and that marking them regparm(2) adds another 20%. */ -REGPRM2 static int __fd_isset(const int fd, int dir) +REGPRM2 static int __fd_is_set(const int fd, int dir) { return FD_ISSET(fd, fd_evts[dir]); } @@ -216,7 +216,7 @@ int select_register(struct poller *p) p->init = select_init; p->term = select_term; p->poll = select_poll; - p->isset = __fd_isset; + p->is_set = __fd_is_set; p->set = __fd_set; p->clr = __fd_clr; p->clo = p->rem = __fd_rem;