[BusyBox] Re: syslogd bug (or feature?)
Gennady Feldman
gena01 at cachier.com
Tue Aug 14 11:21:53 UTC 2001
I have reviewed the patch and it looks ok to commit. The patch addresses the
case where multiple system log messages would be read-in using single read()
statement and they won't be added to system log file. Would somebody commit
it for me? I am re-attaching the diff (using diff -u).
G.F.
On Monday 13 August 2001 05:46 pm, matthias at corelatus.com wrote:
> Hi,
>
> This test program
>
> #include <syslog.h>
>
> int main(int argc, char *argv[]){
> openlog("fail",LOG_CONS,LOG_USER);
> syslog(LOG_INFO,"$Revision: pelle $ starting\n");
>
> while(1){
> syslog(LOG_DEBUG,"line one\n");
> syslog(LOG_DEBUG,"*******line two********\n");
> sleep(1);
> }
> }
>
> Produces a log like this:
>
> Aug 13 23:26:59 gth user.info fail: $Revision: pelle $ starting
> Aug 13 23:26:59 gth user.debug fail: line one
> Aug 13 23:26:59 gth user.debug fail: *******line two********
> Aug 13 23:27:00 gth user.debug fail: line one
> Aug 13 23:27:02 gth user.debug fail: line one
> Aug 13 23:27:03 gth user.debug fail: line one
>
> I.e. it's sometimes (often on our slow board) missing out every second
> log. Digging into the syslogd source (rev. 1.75), I notice that
> serveConnection() reads data from the pipe and then dispatches only the
> _first_ message to logMessage(). Assuming this isn't a feature, I've
> attached a patch which fixes this.
>
> Matthias
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: syslogd.diff
Type: text/x-c
Size: 586 bytes
Desc: Multiple messages read by a single read
Url : http://lists.busybox.net/pipermail/busybox/attachments/20010814/5817ea31/attachment.bin
More information about the busybox
mailing list