From cb04fc3972ef983b9dd6a550e275639e73502527 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 5 Nov 2010 11:02:14 +0100 Subject: permitted imptcp to work on systems which support epoll(), but not epoll_create(). Bug: http://bugzilla.adiscon.com/show_bug.cgi?id=204 Thanks to Nicholas Brink for reporting this problem. --- ChangeLog | 4 ++++ plugins/imptcp/imptcp.c | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e78dcd48..469ee115 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ --------------------------------------------------------------------------- Version 5.6.1 [V5-BETA] (rgerhards), 2010-??-?? +- permitted imptcp to work on systems which support epoll(), but not + epoll_create(). + Bug: http://bugzilla.adiscon.com/show_bug.cgi?id=204 + Thanks to Nicholas Brink for reporting this problem. - bugfix: segfault when an *empty* template was used Bug: http://bugzilla.adiscon.com/show_bug.cgi?id=206 Thanks to David Hill for alerting us. diff --git a/plugins/imptcp/imptcp.c b/plugins/imptcp/imptcp.c index 9b24dbc2..6b14a80e 100644 --- a/plugins/imptcp/imptcp.c +++ b/plugins/imptcp/imptcp.c @@ -1039,7 +1039,14 @@ CODESTARTwillRun ABORT_FINALIZE(RS_RET_NO_RUN); } - if((epollfd = epoll_create1(EPOLL_CLOEXEC)) < 0) { +# if defined(EPOLL_CLOEXEC) && defined(HAVE_EPOLL_CREATE1) + DBGPRINTF("imptcp uses epoll_create1()\n"); + epollfd = epoll_create1(EPOLL_CLOEXEC); +# else + DBGPRINTF("imptcp uses epoll_create()\n"); + epollfd = epoll_create(NUM_EPOLL_EVENTS); +# endif + if(epollfd < 0) { errmsg.LogError(0, RS_RET_EPOLL_CR_FAILED, "error: epoll_create() failed"); ABORT_FINALIZE(RS_RET_NO_RUN); } -- cgit v1.2.3