X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/0599f9cfa6febfb0aa5c106510d72e49e72a65c4..1ac6b2e7857d7b6645dbd09047c4c2ac3b6cef1d:/src/src/log.c diff --git a/src/src/log.c b/src/src/log.c index bfd1fef86..7af92818e 100644 --- a/src/src/log.c +++ b/src/src/log.c @@ -2,7 +2,7 @@ * Exim - an Internet mail transport agent * *************************************************/ -/* Copyright (c) University of Cambridge 1995 - 2009 */ +/* Copyright (c) University of Cambridge 1995 - 2012 */ /* See the file NOTICE for conditions of use and distribution. */ /* Functions for writing log files. The code for maintaining datestamped @@ -528,11 +528,11 @@ Returns: length actually written, persisting an errno from write() */ ssize_t -write_to_fd_buf(int fd, uschar *buf, size_t length) +write_to_fd_buf(int fd, const uschar *buf, size_t length) { ssize_t wrote; size_t total_written = 0; -uschar *p = buf; +const uschar *p = buf; size_t left = length; while (1) @@ -1093,7 +1093,10 @@ if ((flags & LOG_PANIC) != 0) panic_recurseflag = FALSE; if (panic_save_buffer != NULL) - (void) write(paniclogfd, panic_save_buffer, Ustrlen(panic_save_buffer)); + { + int i = write(paniclogfd, panic_save_buffer, Ustrlen(panic_save_buffer)); + i = i; /* compiler quietening */ + } written_len = write_to_fd_buf(paniclogfd, log_buffer, length); if (written_len != length) @@ -1306,7 +1309,7 @@ misconfiguration. The first use of this is in ACL logic, "control = debug/tag=foo/opts=+expand" which can be combined with conditions, etc, to activate extra logging only -for certain sources. */ +for certain sources. The second use is inetd wait mode debug preservation. */ void debug_logging_activate(uschar *tag_name, uschar *opts) @@ -1316,7 +1319,7 @@ int fd = -1; if (debug_file) { debug_printf("DEBUGGING ACTIVATED FROM WITHIN CONFIG.\n" - "DEBUG: Tag=\"%s\" Opts=\"%s\"\n", tag_name, opts); + "DEBUG: Tag=\"%s\" Opts=\"%s\"\n", tag_name, opts ? opts : US""); return; }