also syslog_pid=no and log_selector +pid
since the IETF WG has not yet settled on that versus the original
"bare" representation.
since the IETF WG has not yet settled on that versus the original
"bare" representation.
+JH/39 Fix syslog logging for syslog_timestamp=no and log_selector +millisec.
+ Previously the millisecond value corrupted the output.
+ Fix also for syslog_pid=no and log_selector +pid, for which the pid
+ corrupted the output.
+
Exim version 4.90
-----------------
Exim version 4.90
-----------------
Arguments:
priority syslog priority
Arguments:
priority syslog priority
- s the string to be written, the string may be modified!
+ s the string to be written
Returns: nothing
*/
static void
Returns: nothing
*/
static void
-write_syslog(int priority, uschar *s)
+write_syslog(int priority, const uschar *s)
{
int len, pass;
int linecount = 0;
if (running_in_test_harness) return;
{
int len, pass;
int linecount = 0;
if (running_in_test_harness) return;
-if (!syslog_timestamp) s += log_timezone ? 26 : 20;
if (!syslog_pid && LOGGING(pid))
if (!syslog_pid && LOGGING(pid))
- memmove(s + pid_position[0], s + pid_position[1], pid_position[1] - pid_position[0]);
+ s = string_sprintf("%.*s%s", (int)pid_position[0], s, s + pid_position[1]);
+if (!syslog_timestamp)
+ {
+ len = log_timezone ? 26 : 20;
+ if (LOGGING(millisec)) len += 4;
+ s += len;
+ }
for (i = 1, tlen = len; tlen > 0; i++)
{
int plen = tlen;
for (i = 1, tlen = len; tlen > 0; i++)
{
int plen = tlen;