Fix for file injection is broken on centos computes with Cirros images LP #1587960
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / uclibc / 0.9.33.2 / 0029-inet-rpc-fix-build-in-NPTL-case.patch
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
5
6 __libc_once is not available / needed when multithreading support
7 is not enabled, so authnone_create() calls authnone_create_once()
8 directly.
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.
11
12 Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
13 ---
14  libc/inet/rpc/auth_none.c   |    6 ++++++
15  libc/inet/rpc/rpc_private.h |    1 +
16  2 files changed, 7 insertions(+)
17
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 {
23  };
24  
25  static struct authnone_private_s authnone_private;
26 +#ifdef __UCLIBC_HAS_THREADS__
27  __libc_once_define(static, authnone_private_guard);
28 +#endif
29  
30  static void authnone_create_once (void);
31  
32 @@ -95,7 +97,11 @@ authnone_create_once (void)
33  AUTH *
34  authnone_create (void)
35  {
36 +#ifdef __UCLIBC_HAS_THREADS__
37    __libc_once (authnone_private_guard, authnone_create_once);
38 +#else
39 +  authnone_create_once();
40 +#endif
41    return &authnone_private.no_client;
42  }
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;
49   */
50  #ifdef __UCLIBC_HAS_THREADS__
51  #include <pthread.h>
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 */
56 -- 
57 1.7.10.4
58