summaryrefslogtreecommitdiffstats
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
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.
-rw-r--r--ChangeLog2
-rw-r--r--configure.ac2
-rw-r--r--plugins/imudp/imudp.c11
3 files changed, 12 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index d9027d89..6e6021eb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -16,6 +16,8 @@ Version 5.3.2 [DEVEL] (rgerhards), 2009-10-??
In any case, if there is a shutdown issue, one should carefully look
at this change here!
- enhanced immark to support non-cancel input module termination
+- improved imudp so that epoll can be used in more environments,
+ fixed potential compile time problem if EPOLL_CLOEXEC is not available.
- some cleanup/slight improvement:
* changed imuxsock to no longer use deprecated submitAndParseMsg() IF
* changed submitAndParseMsg() interface to be a wrapper around the new
diff --git a/configure.ac b/configure.ac
index e3f60b5c..8c782762 100644
--- a/configure.ac
+++ b/configure.ac
@@ -107,7 +107,7 @@ AC_TYPE_SIGNAL
AC_FUNC_STAT
AC_FUNC_STRERROR_R
AC_FUNC_VPRINTF
-AC_CHECK_FUNCS([flock basename alarm clock_gettime gethostbyname gethostname gettimeofday localtime_r memset mkdir regcomp select setid socket strcasecmp strchr strdup strerror strndup strnlen strrchr strstr strtol strtoul uname ttyname_r getline malloc_trim prctl epoll_create1 fdatasync])
+AC_CHECK_FUNCS([flock basename alarm clock_gettime gethostbyname gethostname gettimeofday localtime_r memset mkdir regcomp select setid socket strcasecmp strchr strdup strerror strndup strnlen strrchr strstr strtol strtoul uname ttyname_r getline malloc_trim prctl epoll_create epoll_create1 fdatasync])
# Check for MAXHOSTNAMELEN
AC_MSG_CHECKING(for MAXHOSTNAMELEN)
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