tevent: make sure tevent_backend_init() only runs once
authorStefan Metzmacher <metze@samba.org>
Thu, 14 Feb 2013 08:29:57 +0000 (09:29 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 14 Feb 2013 18:19:38 +0000 (10:19 -0800)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
lib/tevent/tevent.c

index 63524710da5c4167986c031876938cd3d36ad320..669b778eb5d721f3fd3444205ff05c71956e2f0c 100644 (file)
@@ -112,6 +112,14 @@ void tevent_set_default_backend(const char *backend)
 */
 static void tevent_backend_init(void)
 {
+       static bool done;
+
+       if (done) {
+               return;
+       }
+
+       done = true;
+
        tevent_select_init();
        tevent_poll_init();
        tevent_poll_mt_init();