struct event_context *smbd_event_context(void)
{
- return NULL;
+ static struct event_context *ev;
+
+ if (!ev) {
+ ev = event_context_init(NULL);
+ }
+ return ev;
}
struct messaging_context *smbd_messaging_context(void)
return false;
}
- /*
- * For clustering, we need to re-init our ctdbd connection after the
- * fork
- */
- status = messaging_reinit(msg_ctx);
- if (!NT_STATUS_IS_OK(status)) {
- DEBUG(0,("messaging_reinit() failed: %s\n",
- nt_errstr(status)));
- return false;
+ if (msg_ctx) {
+ /*
+ * For clustering, we need to re-init our ctdbd connection after the
+ * fork
+ */
+ status = messaging_reinit(msg_ctx);
+ if (!NT_STATUS_IS_OK(status)) {
+ DEBUG(0,("messaging_reinit() failed: %s\n",
+ nt_errstr(status)));
+ return false;
+ }
}
- event_context_reinit(ev_ctx);
+ if (ev_ctx) {
+ event_context_reinit(ev_ctx);
+ }
return true;
}