summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2011-08-11 14:23:19 -0400
committerSimo Sorce <idra@samba.org>2011-08-21 09:05:04 -0400
commitbfd96248185a7a7325a0f5991f2655759905c45e (patch)
tree2ec3857a04e808b61453fcd2665681e2769c17ac /source3/printing
parent5b3eb835f6facf40c2471c99c3b05995c43e7da1 (diff)
downloadsamba-bfd96248185a7a7325a0f5991f2655759905c45e.tar.gz
samba-bfd96248185a7a7325a0f5991f2655759905c45e.tar.bz2
samba-bfd96248185a7a7325a0f5991f2655759905c45e.zip
s3-spoolssd: Fix spoolss logging.
Use the same code as in lsasd. Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/spoolssd.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/source3/printing/spoolssd.c b/source3/printing/spoolssd.c
index c5c30ab104..bc4065c04e 100644
--- a/source3/printing/spoolssd.c
+++ b/source3/printing/spoolssd.c
@@ -108,29 +108,27 @@ static void spoolss_reopen_logs(int child_id)
int rc;
if (child_id) {
- rc = asprintf(&ext, ".%s.%d", DAEMON_NAME, child_id);
+ rc = asprintf(&ext, "%s.%d", DAEMON_NAME, child_id);
} else {
- rc = asprintf(&ext, ".%s", DAEMON_NAME);
+ rc = asprintf(&ext, "%s", DAEMON_NAME);
}
if (rc == -1) {
- /* if we can't allocate, set it to NULL
- * and logging will flow in the original file */
- ext = NULL;
+ return;
}
rc = 0;
if (lfile == NULL || lfile[0] == '\0') {
- rc = asprintf(&lfile, "%s/log%s",
- get_dyn_LOGFILEBASE(), ext?ext:"");
+ rc = asprintf(&lfile, "%s/log.%s",
+ get_dyn_LOGFILEBASE(), ext);
} else {
- if (ext && strstr(lfile, ext) == NULL) {
- if (strstr(lfile, DAEMON_NAME) == NULL) {
- rc = asprintf(&lfile, "%s%s",
- lp_logfile(), ext?ext:"");
- } else {
+ if (strstr(lfile, ext) == NULL) {
+ if (child_id) {
rc = asprintf(&lfile, "%s.%d",
lp_logfile(), child_id);
+ } else {
+ rc = asprintf(&lfile, "%s.%s",
+ lp_logfile(), ext);
}
}
}
@@ -912,7 +910,7 @@ pid_t start_spoolssd(struct tevent_context *ev_ctx,
ret = tevent_loop_wait(ev_ctx);
/* should not be reached */
- DEBUG(0,("background_queue: tevent_loop_wait() exited with %d - %s\n",
+ DEBUG(0,("spoolssd tevent_loop_wait() exited with %d - %s\n",
ret, (ret == 0) ? "out of events" : strerror(errno)));
exit(1);
}