From 851f95b121f2fc16ef5cc532b8ad818f5c32e69f Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 25 Aug 2010 10:15:47 +0200 Subject: s3-spoolssd: Fixed reopening of logs. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Everytime the log was reopened a .spoolssd has been appended which resulted in long file names. Signed-off-by: Günther Deschner --- source3/printing/spoolssd.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/source3/printing/spoolssd.c b/source3/printing/spoolssd.c index 0ba0a95435..899a1f3530 100644 --- a/source3/printing/spoolssd.c +++ b/source3/printing/spoolssd.c @@ -25,17 +25,19 @@ #include "rpc_server/rpc_server.h" #define SPOOLSS_PIPE_NAME "spoolss" - +#define DAEMON_NAME "spoolssd" static void spoolss_reopen_logs(void) { - char *lfile = NULL; - int ret; - - ret = asprintf(&lfile, "%s.spoolssd", lp_logfile()); - if (ret > 0) { - lp_set_logfile(lfile); - SAFE_FREE(lfile); + char *lfile = lp_logfile(); + int rc; + + if (strstr(lfile, DAEMON_NAME) == NULL) { + rc = asprintf(&lfile, "%s.%s", lp_logfile(), DAEMON_NAME); + if (rc > 0) { + lp_set_logfile(lfile); + SAFE_FREE(lfile); + } } reopen_logs(); } -- cgit