nsswitch/wb_common.c: winbind_destructor can always use get_wb_global_ctx()
authorStefan Metzmacher <metze@samba.org>
Fri, 8 Sep 2023 07:53:42 +0000 (09:53 +0200)
committerJule Anger <janger@samba.org>
Mon, 18 Sep 2023 15:59:16 +0000 (15:59 +0000)
The HAVE_PTHREAD logic inside of get_wb_global_ctx() will do all
required magic.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15464

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 836823e5047d0eb18e66707386ba03b812adfaf8)

nsswitch/wb_common.c

index c382a44c1209f48442c71e5338845f25ef43d130..d56e48d9bdb85f5eca5045fb53c6ced3651d52c0 100644 (file)
@@ -246,14 +246,10 @@ static void winbind_destructor(void)
                return;
        }
 
-#ifdef HAVE_PTHREAD_H
-       ctx = (struct winbindd_context *)pthread_getspecific(wb_global_ctx.key);
+       ctx = get_wb_global_ctx();
        if (ctx == NULL) {
                return;
        }
-#else
-       ctx = get_wb_global_ctx();
-#endif
 
        winbind_close_sock(ctx);
 }