summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2010-03-02 10:40:23 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2010-03-02 10:40:23 +0100
commit5402ba982fd8c9bb9ce7fab43ddabaa174ab0794 (patch)
tree812f534d2e39ccd345edac0975c732686b4d7ad5
parenta16c60e782ebed11787e0b5dbd73e83797771b3c (diff)
downloadrsyslog-5402ba982fd8c9bb9ce7fab43ddabaa174ab0794.tar.gz
rsyslog-5402ba982fd8c9bb9ce7fab43ddabaa174ab0794.tar.xz
rsyslog-5402ba982fd8c9bb9ce7fab43ddabaa174ab0794.zip
bugfix: failed to compile on systems without epoll support
-rw-r--r--ChangeLog1
-rw-r--r--plugins/imudp/imudp.c12
-rw-r--r--runtime/nsdpoll_ptcp.c4
-rw-r--r--runtime/nsdpoll_ptcp.h4
4 files changed, 12 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index f7ce121b..80336814 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
Version 5.5.3 [DEVEL] (rgerhards), 2010-02-??
- added capability to turn off standard LF delimiter in TCP server
via new directive "$InputTCPServerDisableLFDelimiter on"
+- bugfix: failed to compile on systems without epoll support
- bugfix: comment char ('#') in literal terminated script parsing
and thus could not be used.
but tracker: http://bugzilla.adiscon.com/show_bug.cgi?id=119
diff --git a/plugins/imudp/imudp.c b/plugins/imudp/imudp.c
index 07a07d74..5c8e2859 100644
--- a/plugins/imudp/imudp.c
+++ b/plugins/imudp/imudp.c
@@ -377,11 +377,9 @@ rsRetVal rcvMainLoop(thrdInfo_t *pThrd)
int maxfds;
int nfds;
int i;
+ fd_set readfds;
struct sockaddr_storage frominetPrev;
int bIsPermitted;
- uchar fromHost[NI_MAXHOST];
- uchar fromHostIP[NI_MAXHOST];
- uchar fromHostFQDN[NI_MAXHOST];
/* start "name caching" algo by making sure the previous system indicator
* is invalidated.
@@ -398,21 +396,21 @@ rsRetVal rcvMainLoop(thrdInfo_t *pThrd)
* is given without -a, we do not need to listen at all..
*/
maxfds = 0;
- FD_ZERO (pReadfds);
+ FD_ZERO(&readfds);
/* Add the UDP listen sockets to the list of read descriptors. */
for (i = 0; i < *udpLstnSocks; i++) {
if (udpLstnSocks[i+1] != -1) {
if(Debug)
net.debugListenInfo(udpLstnSocks[i+1], "UDP");
- FD_SET(udpLstnSocks[i+1], pReadfds);
+ FD_SET(udpLstnSocks[i+1], &readfds);
if(udpLstnSocks[i+1]>maxfds) maxfds=udpLstnSocks[i+1];
}
}
if(Debug) {
dbgprintf("--------imUDP calling select, active file descriptors (max %d): ", maxfds);
for (nfds = 0; nfds <= maxfds; ++nfds)
- if ( FD_ISSET(nfds, pReadfds) )
+ if(FD_ISSET(nfds, &readfds))
dbgprintf("%d ", nfds);
dbgprintf("\n");
}
@@ -425,7 +423,7 @@ rsRetVal rcvMainLoop(thrdInfo_t *pThrd)
for(i = 0; nfds && i < *udpLstnSocks; i++) {
if(FD_ISSET(udpLstnSocks[i+1], &readfds)) {
processSocket(pThrd, udpLstnSocks[i+1], &frominetPrev, &bIsPermitted,
- fromHost, fromHostFQDN, fromHostIP, udpRulesets[i+1]);
+ udpRulesets[i+1]);
--nfds; /* indicate we have processed one descriptor */
}
}
diff --git a/runtime/nsdpoll_ptcp.c b/runtime/nsdpoll_ptcp.c
index 85aac04c..51006707 100644
--- a/runtime/nsdpoll_ptcp.c
+++ b/runtime/nsdpoll_ptcp.c
@@ -24,6 +24,8 @@
*/
#include "config.h"
+#ifdef HAVE_EPOLL_CREATE /* this module requires epoll! */
+
#include <stdlib.h>
#include <assert.h>
#include <errno.h>
@@ -280,5 +282,7 @@ BEGINObjClassInit(nsdpoll_ptcp, 1, OBJ_IS_CORE_MODULE) /* class, version */
/* set our own handlers */
ENDObjClassInit(nsdpoll_ptcp)
+#endif /* #ifdef HAVE_EPOLL_CREATE this module requires epoll! */
+
/* vi:set ai:
*/
diff --git a/runtime/nsdpoll_ptcp.h b/runtime/nsdpoll_ptcp.h
index 0708e489..cea2823d 100644
--- a/runtime/nsdpoll_ptcp.h
+++ b/runtime/nsdpoll_ptcp.h
@@ -27,8 +27,6 @@
#include "nsd.h"
#if HAVE_SYS_EPOLL_H
# include <sys/epoll.h>
-#else
- typedef void epoll_event_t;
#endif
typedef nsdpoll_if_t nsdpoll_ptcp_if_t; /* we just *implement* this interface */
/* a helper object to keep track of the epoll event records
@@ -37,7 +35,9 @@ typedef nsdpoll_if_t nsdpoll_ptcp_if_t; /* we just *implement* this interface */
*/
typedef struct nsdpoll_epollevt_lst_s nsdpoll_epollevt_lst_t;
struct nsdpoll_epollevt_lst_s {
+#if HAVE_SYS_EPOLL_H
epoll_event_t event;
+#endif
int id;
void *pUsr;
nsd_ptcp_t *pSock; /* our associated netstream driver data */