aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-extended/sblim-sfcb/sblim-sfcb/0001-Avoid-variable-definition-in-header-files.patch
blob: b0b43f357c3127e4bc861322956878f48bac2c0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
From fccbb85beb89b9ca35cac87fb553ef124a6c516b Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 13 Aug 2020 17:26:14 -0700
Subject: [PATCH] Avoid variable definition in header files

This can cause multiple definitions to be emitted into objects and link
fail as a result with gcc-10+ since it defaults to -fno-common, patch
moves the definitions to source files

Upstream-Status: Pending

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 control.h     | 2 +-
 providerMgr.c | 1 +
 providerMgr.h | 2 +-
 sfcBroker.c   | 2 +-
 trace.c       | 1 +
 trace.h       | 2 +-
 6 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/control.h b/control.h
index e41e4b9..5e15363 100644
--- a/control.h
+++ b/control.h
@@ -28,7 +28,7 @@ int             getControlUNum(char *id, unsigned int *val);
 int             getControlULong(char *id, unsigned long *val);
 int             getControlNum(char *id, long *val);
 int             getControlBool(char *id, int *val);
-const char      * sfcBrokerStart;
+extern const char * sfcBrokerStart;
 
 #endif
 /* MODELINES */
diff --git a/providerMgr.c b/providerMgr.c
index c38a7d3..ff6d38d 100644
--- a/providerMgr.c
+++ b/providerMgr.c
@@ -53,6 +53,7 @@
 #define SFCB_ASM(x)
 #endif
 
+sigset_t mask, old_mask;
 static pthread_mutex_t resultsocketMutex = PTHREAD_MUTEX_INITIALIZER;
 
 extern CMPIBroker *Broker;
diff --git a/providerMgr.h b/providerMgr.h
index 3cc7745..fbbfecd 100644
--- a/providerMgr.h
+++ b/providerMgr.h
@@ -398,7 +398,7 @@ BinResponseHdr **invokeProviders(BinRequestContext * binCtx, int *err,
 BinResponseHdr *invokeProvider(BinRequestContext * ctx);
 void            freeResponseHeaders(BinResponseHdr ** resp,
                                     BinRequestContext * ctx);
-sigset_t mask, old_mask;
+extern sigset_t mask, old_mask;
 
 #endif
 /* MODELINES */
diff --git a/sfcBroker.c b/sfcBroker.c
index ca043c9..85581f5 100644
--- a/sfcBroker.c
+++ b/sfcBroker.c
@@ -53,7 +53,7 @@
 #endif
 
 int             sfcBrokerPid = 0;
-
+const char     *sfcBrokerStart;
 extern int      sfcbUseSyslog;
 
 extern void     setExFlag(unsigned long f);
diff --git a/trace.c b/trace.c
index 438af46..23597e1 100644
--- a/trace.c
+++ b/trace.c
@@ -52,6 +52,7 @@ char           *processName = NULL;
 int             providerProcess = 0;
 int             idleThreadId = 0;
 int             terminating = 0;
+int             colorTrace;
 
 int             _sfcb_debug = 0;
 unsigned long   _sfcb_trace_mask = 0;
diff --git a/trace.h b/trace.h
index 2c6d8be..ea39850 100644
--- a/trace.h
+++ b/trace.h
@@ -130,7 +130,7 @@ typedef struct traceId {
 #define CYAN            6
 #define WHITE           7
 void            changeTextColor(int reset);
-int             colorTrace;
+extern int      colorTrace;
 
 #define MAX_MSG_SIZE 1024       /* max length of trace message */
 
-- 
2.28.0