diff options
author | Volker Lendecke <vlendec@samba.org> | 2007-05-15 13:44:11 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:22:06 -0500 |
commit | ab7a9d2bbe95ac2194db7eb358e3bf1ba4aa8890 (patch) | |
tree | fcf302a54401c8d8bc8eac9617957ebb13ea53df /source3/nmbd/nmbd.c | |
parent | 83a7d9558b5eb686863d44bd7ef00a9e5926edfd (diff) | |
download | samba-ab7a9d2bbe95ac2194db7eb358e3bf1ba4aa8890.tar.gz |
r22902: Add an event_context and a messaging_context to nmbd. Not used yet.
(This used to be commit 6d210fb8a13e93fe5b7bc160a343f74878dea727)
Diffstat (limited to 'source3/nmbd/nmbd.c')
-rw-r--r-- | source3/nmbd/nmbd.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c index 6e0de362b9..f328673a55 100644 --- a/source3/nmbd/nmbd.c +++ b/source3/nmbd/nmbd.c @@ -40,6 +40,27 @@ BOOL found_lm_clients = False; 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\n"); + } + return ctx; +} + +struct messaging_context *nmbd_messaging_context(void) +{ + static struct messaging_context *ctx; + + if (!ctx && !(ctx = messaging_init(NULL, server_id_self(), + nmbd_event_context()))) { + smb_panic("Could not init nmbd messaging context\n"); + } + return ctx; +} + /**************************************************************************** ** Handle a SIGTERM in band. **************************************************************************** */ @@ -732,6 +753,11 @@ static BOOL open_sockets(enum smb_server_mode server_mode, int port) setpgid( (pid_t)0, (pid_t)0 ); #endif + message_init(); + if (nmbd_messaging_context() == NULL) { + return 1; + } + #ifndef SYNC_DNS /* Setup the async dns. We do it here so it doesn't have all the other stuff initialised and thus chewing memory and sockets */ @@ -745,7 +771,6 @@ static BOOL open_sockets(enum smb_server_mode server_mode, int port) } pidfile_create("nmbd"); - message_init(); message_register(MSG_FORCE_ELECTION, nmbd_message_election, NULL); #if 0 /* Until winsrepl is done. */ |