summaryrefslogtreecommitdiffstats
path: root/source3/winbindd/winbindd_cm.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-01-06 17:34:06 -0800
committerJeremy Allison <jra@samba.org>2009-01-06 17:34:06 -0800
commitd1f7a3717406de855169e88ebc5a9da2318c99ef (patch)
tree3785a001f9d6eb0ea3defa7fa815410f344cef19 /source3/winbindd/winbindd_cm.c
parente13983870f00f83420cca554a541165214dc4e06 (diff)
downloadsamba-d1f7a3717406de855169e88ebc5a9da2318c99ef.tar.gz
samba-d1f7a3717406de855169e88ebc5a9da2318c99ef.tar.xz
samba-d1f7a3717406de855169e88ebc5a9da2318c99ef.zip
Make winbindd_cm.c use winbindd_reinit_after_fork().
Jeremy.
Diffstat (limited to 'source3/winbindd/winbindd_cm.c')
-rw-r--r--source3/winbindd/winbindd_cm.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
index e5e35656045..4e5659d9031 100644
--- a/source3/winbindd/winbindd_cm.c
+++ b/source3/winbindd/winbindd_cm.c
@@ -172,6 +172,7 @@ static bool fork_child_dc_connect(struct winbindd_domain *domain)
int num_dcs = 0;
TALLOC_CTX *mem_ctx = NULL;
pid_t parent_pid = sys_getpid();
+ char *lfile = NULL;
/* Stop zombies */
CatchChild();
@@ -212,9 +213,14 @@ static bool fork_child_dc_connect(struct winbindd_domain *domain)
/* Leave messages blocked - we will never process one. */
- if (!reinit_after_fork(winbind_messaging_context(),
- winbind_event_context(), true)) {
- DEBUG(0,("reinit_after_fork() failed\n"));
+ if (!override_logfile) {
+ if (asprintf(&lfile, "%s/log.winbindd-dc-connect", get_dyn_LOGFILEBASE()) == -1) {
+ DEBUG(0, ("fork_child_dc_connect: out of memory.\n"));
+ return false;
+ }
+ }
+
+ if (!winbindd_reinit_after_fork(lfile)) {
messaging_send_buf(winbind_messaging_context(),
pid_to_procid(parent_pid),
MSG_WINBIND_FAILED_TO_GO_ONLINE,
@@ -222,17 +228,7 @@ static bool fork_child_dc_connect(struct winbindd_domain *domain)
strlen(domain->name)+1);
_exit(0);
}
-
- close_conns_after_fork();
-
- if (!override_logfile) {
- char *lfile;
- if (asprintf(&lfile, "%s/log.winbindd-dc-connect", get_dyn_LOGFILEBASE()) > 0) {
- lp_set_logfile(lfile);
- SAFE_FREE(lfile);
- reopen_logs();
- }
- }
+ SAFE_FREE(lfile);
mem_ctx = talloc_init("fork_child_dc_connect");
if (!mem_ctx) {