Use the same code as in lsasd.
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
- rc = asprintf(&ext, ".%s.%d", DAEMON_NAME, child_id);
+ rc = asprintf(&ext, "%s.%d", DAEMON_NAME, child_id);
- rc = asprintf(&ext, ".%s", DAEMON_NAME);
+ rc = asprintf(&ext, "%s", DAEMON_NAME);
- /* if we can't allocate, set it to NULL
- * and logging will flow in the original file */
- ext = NULL;
}
rc = 0;
if (lfile == NULL || lfile[0] == '\0') {
}
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);
- 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);
rc = asprintf(&lfile, "%s.%d",
lp_logfile(), child_id);
+ } else {
+ rc = asprintf(&lfile, "%s.%s",
+ lp_logfile(), ext);
ret = tevent_loop_wait(ev_ctx);
/* should not be reached */
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);
}
ret, (ret == 0) ? "out of events" : strerror(errno)));
exit(1);
}