The syslog_daemon now ignores zero length messages, and the kernel's syslog
mechanism doesn't send them out any longer. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16153 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
bd610d2fcd
commit
afef4f3fff
|
@ -138,6 +138,11 @@ SyslogDaemon::Daemon()
|
|||
// add terminating null byte
|
||||
message.message[bytesRead - sizeof(syslog_message)] = '\0';
|
||||
|
||||
if (!message.message[0]) {
|
||||
// ignore empty messages
|
||||
continue;
|
||||
}
|
||||
|
||||
fHandlerLock.Lock();
|
||||
|
||||
for (int32 i = fHandlers.CountItems(); i-- > 0;) {
|
||||
|
|
|
@ -164,6 +164,8 @@ syslog_output(syslog_message &message)
|
|||
} else {
|
||||
length = strlcpy(buffer + headerLength, message.message + pos,
|
||||
sizeof(buffer) - headerLength);
|
||||
if (length == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
length += headerLength;
|
||||
|
|
|
@ -431,6 +431,12 @@ syslog_sender(void *data)
|
|||
restore_interrupts(state);
|
||||
}
|
||||
|
||||
if (length == 0) {
|
||||
// the buffer we came here for might have been sent already
|
||||
bufferPending = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
error = write_port_etc(port, SYSLOG_MESSAGE, sSyslogMessage,
|
||||
sizeof(struct syslog_message) + length, B_RELATIVE_TIMEOUT, 0);
|
||||
|
||||
|
|
Loading…
Reference in New Issue