nmbd: untangle logic in nmbd_messaging_context() slightly.
authorMichael Adam <obnox@samba.org>
Tue, 24 Jun 2008 10:46:13 +0000 (12:46 +0200)
committerMichael Adam <obnox@samba.org>
Thu, 26 Jun 2008 10:31:11 +0000 (12:31 +0200)
Michael
(This used to be commit 3baf9eb6a2cc6a4a153303b457d3a7067948495e)

source3/nmbd/nmbd.c

index 5126715a47f7ddd9e16f77388dd21752e6e919ce..46c3f1dd3c90c7e1914e4f3facf45dc9d0ec8d52 100644 (file)
@@ -52,8 +52,11 @@ struct messaging_context *nmbd_messaging_context(void)
 {
        static struct messaging_context *ctx;
 
-       if (!ctx && !(ctx = messaging_init(NULL, server_id_self(),
-                                          nmbd_event_context()))) {
+       if (ctx == NULL) {
+               ctx = messaging_init(NULL, server_id_self(),
+                                    nmbd_event_context());
+       }
+       if (ctx == NULL) {
                DEBUG(0, ("Could not init nmbd messaging context.\n"));
        }
        return ctx;