summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-02-11 07:47:27 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-02-11 07:47:27 +0000
commita745208787f3b2752e17d3171ca3e2a2f4f0d5c4 (patch)
tree5285880eb3e97a164f1f6e0ec31d13f56d92f716
parent463e2d8f186e631d07cf8e45b62c725fbc817f8e (diff)
downloadrsyslog-a745208787f3b2752e17d3171ca3e2a2f4f0d5c4.tar.gz
rsyslog-a745208787f3b2752e17d3171ca3e2a2f4f0d5c4.tar.xz
rsyslog-a745208787f3b2752e17d3171ca3e2a2f4f0d5c4.zip
bugfix: errno could be changed during mark processing, leading to invalid
error messages when processing inputs. Thank to varmojfekoj for pointing out this problem.
-rw-r--r--ChangeLog3
-rw-r--r--syslogd.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 065956b9..172f3f31 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,9 @@ Version 2.0.2 STABLE (rgerhards), 2008-02-??
they run rsyslog ;))
- bugfix: suspended actions were not always properly resumed
varmojfekoj provided the patch - many thanks!
+- bugfix: errno could be changed during mark processing, leading to
+ invalid error messages when processing inputs. Thank to varmojfekoj for
+ pointing out this problem.
---------------------------------------------------------------------------
Version 2.0.1 STABLE (rgerhards), 2008-01-24
- fixed a bug in integer conversion - but this function was never called,
diff --git a/syslogd.c b/syslogd.c
index c6c5dc2f..ad740524 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -5898,6 +5898,7 @@ static void mainloop(void)
int i;
int maxfds;
int nfds;
+ int errnoSave;
#ifdef SYSLOG_INET
selectHelperWriteFDSInfo_t writeFDSInfo;
fd_set writefds;
@@ -6036,6 +6037,7 @@ static void mainloop(void)
#endif
nfds = select(maxfds+1, (fd_set *) &readfds, MAIN_SELECT_WRITEFDS,
(fd_set *) NULL, MAIN_SELECT_TIMEVAL);
+ errnoSave = errno; /* save errno for later reference */
if(bRequestDoMark) {
domark();
@@ -6056,6 +6058,7 @@ static void mainloop(void)
continue;
}
+ errno = errnoSave; /* restore errno to state right after select (which is what we need) -- rgerhards, 2008-02-11 */
processSelectAfter(maxfds, nfds, &readfds, MAIN_SELECT_WRITEFDS);
#undef MAIN_SELECT_TIMEVAL