1 From 3a732cacd650bd39d86ac13ba0f57eee0df82d5a Mon Sep 17 00:00:00 2001
2 From: Carmelo Amoroso <carmelo.amoroso@st.com>
3 Date: Wed, 14 Mar 2012 15:21:36 +0100
4 Subject: [PATCH] inet:rpc: fix build in !NPTL case
6 __libc_once is not available / needed when multithreading support
7 is not enabled, so authnone_create() calls authnone_create_once()
9 When LT.{old,new} is used instead of NPTL, it needs to explicitly
10 include <bits/libc-lock.h> to get __libc_once to be visible.
12 Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
14 libc/inet/rpc/auth_none.c | 6 ++++++
15 libc/inet/rpc/rpc_private.h | 1 +
16 2 files changed, 7 insertions(+)
18 diff --git a/libc/inet/rpc/auth_none.c b/libc/inet/rpc/auth_none.c
19 index d066f6b..70bee5b 100644
20 --- a/libc/inet/rpc/auth_none.c
21 +++ b/libc/inet/rpc/auth_none.c
22 @@ -68,7 +68,9 @@ struct authnone_private_s {
25 static struct authnone_private_s authnone_private;
26 +#ifdef __UCLIBC_HAS_THREADS__
27 __libc_once_define(static, authnone_private_guard);
30 static void authnone_create_once (void);
32 @@ -95,7 +97,11 @@ authnone_create_once (void)
34 authnone_create (void)
36 +#ifdef __UCLIBC_HAS_THREADS__
37 __libc_once (authnone_private_guard, authnone_create_once);
39 + authnone_create_once();
41 return &authnone_private.no_client;
43 libc_hidden_def(authnone_create)
44 diff --git a/libc/inet/rpc/rpc_private.h b/libc/inet/rpc/rpc_private.h
45 index e1214d2..38ade1c 100644
46 --- a/libc/inet/rpc/rpc_private.h
47 +++ b/libc/inet/rpc/rpc_private.h
48 @@ -12,6 +12,7 @@ extern u_long _create_xid (void) attribute_hidden;
50 #ifdef __UCLIBC_HAS_THREADS__
52 +#include <bits/libc-lock.h>
53 struct rpc_thread_variables {
54 fd_set svc_fdset_s; /* Global, rpc_common.c */
55 struct rpc_createerr rpc_createerr_s; /* Global, rpc_common.c */