summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2007-12-21 16:25:55 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2007-12-21 16:25:55 +0000
commitc26059ea2689f5331f9820caf92a8a52a5006bfc (patch)
tree08d1f3e4b2a0ca83cdcfaa0824be5f2611e783a5
parentfe6b6de3035b6bcea07f302ec0ef2895ac6f2285 (diff)
downloadrsyslog-c26059ea2689f5331f9820caf92a8a52a5006bfc.tar.gz
rsyslog-c26059ea2689f5331f9820caf92a8a52a5006bfc.tar.xz
rsyslog-c26059ea2689f5331f9820caf92a8a52a5006bfc.zip
removed code no longer needed
-rw-r--r--syslogd.c63
-rw-r--r--threads.c2
2 files changed, 9 insertions, 56 deletions
diff --git a/syslogd.c b/syslogd.c
index 317a5d6c..2641788a 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -5367,68 +5367,27 @@ static void processImInternal(void)
}
-/* process the select() selector array after the successful select.
- * processing is completed as soon as all selectors needing attention
- * are processed.
- * rgerhards, 2007-08-08
- */
-static rsRetVal processSelectAfter(int maxfds, int nfds, fd_set *pReadfds)
-{
- DEFiRet;
- int i;
-
- /* the following macro is used to decrement the number of to-be-probed
- * fds and abort this function when we are done with all.
- */
-# define FDPROCESSED() if(--nfds == 0) { ABORT_FINALIZE(RS_RET_OK); }
-
- if (nfds < 0) {
- if (errno != EINTR)
- logerror("select");
- dbgprintf("Select interrupted.\n");
- ABORT_FINALIZE(RS_RET_OK); /* we are done in any case */
- }
-
- if(debugging_on) {
- dbgprintf("\nSuccessful select, descriptor count = %d, Activity on: ", nfds);
- for (i = 0; i <= maxfds; ++i)
- if ( FD_ISSET(i, pReadfds) )
- dbgprintf("%d ", i);
- dbgprintf(("\n"));
- }
-finalize_it:
- return iRet;
-}
-
-
/* This is the main processing loop. It is called after successful initialization.
* When it returns, the syslogd terminates.
*/
-static void mainloop(void)
+static void
+mainloop(void)
{
- fd_set readfds;
- int i;
- int maxfds;
- int nfds;
-
while(!bFinished){
- errno = 0;
- maxfds = 0;
- FD_ZERO (&readfds);
-
/* first check if we have any internal messages queued and spit them out */
+ /* TODO: do we need this any longer? I doubt it, but let's care about it
+ * later -- rgerhards, 2007-12-21
+ */
processImInternal();
if ( debugging_on ) {
dbgprintf("----------------------------------------\n");
- dbgprintf("Calling select, active file descriptors (max %d): ", maxfds);
- for (nfds= 0; nfds <= maxfds; ++nfds)
- if ( FD_ISSET(nfds, &readfds) )
- dbgprintf("%d ", nfds);
+ dbgprintf("Calling select, without file descriptors.");
dbgprintf("\n");
}
- nfds = select(maxfds+1, (fd_set *) &readfds, NULL, NULL, NULL);
+ /* this is now just a wait */
+ select(1, NULL, NULL, NULL, NULL);
if(bRequestDoMark) {
domark();
@@ -5444,12 +5403,6 @@ static void mainloop(void)
restart = 0;
continue;
}
- if (nfds == 0) {
- dbgprintf("No select activity.\n");
- continue;
- }
-
- processSelectAfter(maxfds, nfds, &readfds);
}
}
diff --git a/threads.c b/threads.c
index ea79c380..ea0fb19b 100644
--- a/threads.c
+++ b/threads.c
@@ -253,7 +253,7 @@ thrdSleep(thrdInfo_t *pThis, int iSeconds, int iuSeconds)
/* there may be a race condition if pthread_kill() is called after unblock but
* before the select() is setup. TODO: check and re-eval -- rgerhards, 2007-12-20
*/
- select(0, NULL, NULL, NULL, &tvSelectTimeout);
+ select(1, NULL, NULL, NULL, &tvSelectTimeout);
if(pThis->bShallStop)
iRet = RS_RET_TERMINATE_NOW;
else