diff options
author | Jeremy Allison <jra@samba.org> | 2010-11-13 20:28:41 -0800 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2010-11-14 04:39:05 +0000 |
commit | 781c4aabb87e63df77c76a360b6ed5f6a20e6d58 (patch) | |
tree | e53eb195b8116ab29b73c34c3f00474b9c137d0c /source3/nmbd | |
parent | 7cb0f95bf28c24c45955d6df52f505019341ef31 (diff) | |
download | samba-781c4aabb87e63df77c76a360b6ed5f6a20e6d58.tar.gz samba-781c4aabb87e63df77c76a360b6ed5f6a20e6d58.tar.bz2 samba-781c4aabb87e63df77c76a360b6ed5f6a20e6d58.zip |
Move error reporting of messaging context creation fail into
the daemons themselves. Allows client utilities to silently
fail to create a messaging context due to access denied on the
messaging tdb (which I need for the following patch).
Jeremy.
Diffstat (limited to 'source3/nmbd')
-rw-r--r-- | source3/nmbd/nmbd.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c index 2bae5f7b27..d6943b19e6 100644 --- a/source3/nmbd/nmbd.c +++ b/source3/nmbd/nmbd.c @@ -43,26 +43,17 @@ time_t StartupTime = 0; struct event_context *nmbd_event_context(void) { - static struct event_context *ctx; - - if (!ctx && !(ctx = event_context_init(NULL))) { - smb_panic("Could not init nmbd event context"); - } - return ctx; + return server_event_context(); } struct messaging_context *nmbd_messaging_context(void) { - static struct messaging_context *ctx; - - if (ctx == NULL) { - ctx = messaging_init(NULL, procid_self(), - nmbd_event_context()); - } - if (ctx == NULL) { - DEBUG(0, ("Could not init nmbd messaging context.\n")); + struct messaging_context *msg_ctx = server_messaging_context(); + if (likely(msg_ctx != NULL)) { + return msg_ctx; } - return ctx; + smb_panic("Could not init nmbd's messaging context.\n"); + return NULL; } /**************************************************************************** ** |