diff options
author | Andreas Schneider <asn@samba.org> | 2010-08-25 10:15:47 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2011-03-29 16:03:51 +0200 |
commit | 851f95b121f2fc16ef5cc532b8ad818f5c32e69f (patch) | |
tree | ed64badff15833fa46f05d5ae3420645bc8df60d /source3 | |
parent | fe0e079bc12ebe2e9204ca492337dc754e13832b (diff) | |
download | samba-851f95b121f2fc16ef5cc532b8ad818f5c32e69f.tar.gz samba-851f95b121f2fc16ef5cc532b8ad818f5c32e69f.tar.bz2 samba-851f95b121f2fc16ef5cc532b8ad818f5c32e69f.zip |
s3-spoolssd: Fixed reopening of logs.
Everytime the log was reopened a .spoolssd has been appended which
resulted in long file names.
Signed-off-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'source3')
-rw-r--r-- | source3/printing/spoolssd.c | 18 |
1 files 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(); } |