git://git.exim.org
/
exim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Logging: fix syslog logging for syslog_timestamp=no and log_selector +millisec
[exim.git]
/
src
/
src
/
log.c
diff --git
a/src/src/log.c
b/src/src/log.c
index db82925e5527571fc2567413a21c72a5631ba7a7..16f58d26b3c5db919175690f85a3c505644f34fe 100644
(file)
--- a/
src/src/log.c
+++ b/
src/src/log.c
@@
-2,7
+2,7
@@
* Exim - an Internet mail transport agent *
*************************************************/
* Exim - an Internet mail transport agent *
*************************************************/
-/* Copyright (c) University of Cambridge 1995 - 201
7
*/
+/* Copyright (c) University of Cambridge 1995 - 201
8
*/
/* See the file NOTICE for conditions of use and distribution. */
/* Functions for writing log files. The code for maintaining datestamped
/* See the file NOTICE for conditions of use and distribution. */
/* Functions for writing log files. The code for maintaining datestamped
@@
-134,22
+134,27
@@
can get here if there is a failure to open the panic log.)
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;
+ }
len = Ustrlen(s);
len = Ustrlen(s);
@@
-172,7
+177,7
@@
for (pass = 0; pass < 2; pass++)
{
int i;
int tlen;
{
int i;
int tlen;
-
uschar *
ss = s;
+
const uschar *
ss = s;
for (i = 1, tlen = len; tlen > 0; i++)
{
int plen = tlen;
for (i = 1, tlen = len; tlen > 0; i++)
{
int plen = tlen;