diff options
author | Carmelo Amoroso <carmelo.amoroso@st.com> | 2012-03-14 15:21:36 +0100 |
---|---|---|
committer | Carmelo Amoroso <carmelo.amoroso@st.com> | 2012-03-26 09:54:49 +0200 |
commit | 21d6091b0de9448e9f160904b0b35d2cc764a4ea (patch) | |
tree | 9d5213a97bd8e8a85237f3025bf917b9fe78ef12 /libc/inet/rpc/auth_none.c | |
parent | c3393906d84d0d9cb7d688e0f2bbf8cde92190a2 (diff) |
inet:rpc: fix build in !NPTL case
__libc_once is not available / needed when multithreading support
is not enabled, so authnone_create() calls authnone_create_once()
directly.
When LT.{old,new} is used instead of NPTL, it needs to explicitly
include <bits/libc-lock.h> to get __libc_once to be visible.
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Diffstat (limited to 'libc/inet/rpc/auth_none.c')
-rw-r--r-- | libc/inet/rpc/auth_none.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libc/inet/rpc/auth_none.c b/libc/inet/rpc/auth_none.c index d066f6b5d..70bee5b57 100644 --- a/libc/inet/rpc/auth_none.c +++ b/libc/inet/rpc/auth_none.c @@ -68,7 +68,9 @@ struct authnone_private_s { }; static struct authnone_private_s authnone_private; +#ifdef __UCLIBC_HAS_THREADS__ __libc_once_define(static, authnone_private_guard); +#endif static void authnone_create_once (void); @@ -95,7 +97,11 @@ authnone_create_once (void) AUTH * authnone_create (void) { +#ifdef __UCLIBC_HAS_THREADS__ __libc_once (authnone_private_guard, authnone_create_once); +#else + authnone_create_once(); +#endif return &authnone_private.no_client; } libc_hidden_def(authnone_create) |