summaryrefslogtreecommitdiffstats
path: root/plugins/imudp
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-10-15 13:40:10 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-10-15 13:40:10 +0200
commit5b1eb920914d97aee68b674459b68e99957c80d6 (patch)
tree5b259f98b2a5ad43f13777a2528158bb1bd65b6f /plugins/imudp
parent11c3b7d9e4198396dbe0bfa0308d80901072c673 (diff)
downloadrsyslog-5b1eb920914d97aee68b674459b68e99957c80d6.tar.gz
rsyslog-5b1eb920914d97aee68b674459b68e99957c80d6.tar.xz
rsyslog-5b1eb920914d97aee68b674459b68e99957c80d6.zip
improved imudp so that epoll can be used in more environments
Fixed potential compile time problem if EPOLL_CLOEXEC is not available.
Diffstat (limited to 'plugins/imudp')
-rw-r--r--plugins/imudp/imudp.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/plugins/imudp/imudp.c b/plugins/imudp/imudp.c
index 12946c39..3159de4f 100644
--- a/plugins/imudp/imudp.c
+++ b/plugins/imudp/imudp.c
@@ -293,7 +293,7 @@ finalize_it:
* interface. ./configure settings control which one is used.
* rgerhards, 2009-09-09
*/
-#if HAVE_EPOLL_CREATE1
+#if defined(HAVE_EPOLL_CREATE1) || defined(HAVE_EPOLL_CREATE)
#define NUM_EPOLL_EVENTS 10
rsRetVal rcvMainLoop()
{
@@ -318,7 +318,13 @@ rsRetVal rcvMainLoop()
CHKmalloc(udpEPollEvt = calloc(udpLstnSocks[0], sizeof(struct epoll_event)));
- efd = epoll_create1(EPOLL_CLOEXEC);
+# if defined(EPOLL_CLOEXEC) && defined(HAVE_EPOLL_CREATE1)
+ DBGPRINTF("imudp uses epoll_create1()\n");
+ efd = epoll_create1(EPOLL_CLOEXEC);
+# else
+ DBGPRINTF("imudp uses epoll_create()\n");
+ efd = epoll_create();
+# endif
if(efd < 0) {
DBGPRINTF("epoll_create1() could not create fd\n");
ABORT_FINALIZE(RS_RET_IO_ERROR);
@@ -379,6 +385,7 @@ rsRetVal rcvMainLoop()
*/
bIsPermitted = 0;
memset(&frominetPrev, 0, sizeof(frominetPrev));
+ DBGPRINTF("imudp uses select()\n");
while(1) {
/* Add the Unix Domain Sockets to the list of read