static int logging_mode = LOG_MODE_FILE;
static uschar *file_path = US"";
+static size_t pid_position[2];
+
/* These should be kept in-step with the private delivery error
number definitions in macros.h */
Arguments:
priority syslog priority
- s the string to be written
+ s the string to be written, the string may be modified!
Returns: nothing
*/
if (running_in_test_harness) return;
if (!syslog_timestamp) s += log_timezone? 26 : 20;
+if (!syslog_pid && LOGGING(pid))
+ memmove(s + pid_position[0], s + pid_position[1], pid_position[1] - pid_position[0]);
len = Ustrlen(s);
if (LOGGING(pid))
{
sprintf(CS ptr, "[%d] ", (int)getpid());
+ if (!syslog_pid) pid_position[0] = ptr - log_buffer; /* remember begin … */
while (*ptr) ptr++;
+ if (!syslog_pid) pid_position[1] = ptr - log_buffer; /* … and end+1 of the PID */
}
if (really_exim && message_id[0] != 0)