Magellan Linux

Contents of /trunk/systemd/patches/systemd-238-fix-libgpg-error-header-issues.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3129 - (show annotations) (download)
Wed Jun 13 15:43:08 2018 UTC (11 days, 22 hours ago) by niro
File size: 6832 byte(s)
-fix ftbfs against newer libgpg-error
1 From: Franck Bui <fbui@suse.com>
2 Date: Thu, 15 Mar 2018 06:23:46 +0100
3 Subject: basic/macros: rename noreturn into _noreturn_ (#8456)
4
5 "noreturn" is reserved and can be used in other header files we include:
6
7 [ 16s] In file included from /usr/include/gcrypt.h:30:0,
8 [ 16s] from ../src/journal/journal-file.h:26,
9 [ 16s] from ../src/journal/journal-vacuum.c:31:
10 [ 16s] /usr/include/gpg-error.h:1544:46: error: expected ',' or ';' before ')' token
11 [ 16s] void gpgrt_log_bug (const char *fmt, ...) GPGRT_ATTR_NR_PRINTF(1,2);
12
13 Here we include grcrypt.h (which in turns include gpg-error.h) *after* we
14 "noreturn" was defined in macro.h.
15
16 (cherry picked from commit 848e863acc51ecfb0f3955c498874588201d9130)
17 ---
18 src/basic/log.c | 4 ++--
19 src/basic/log.h | 4 ++--
20 src/basic/macro.h | 19 +++++++++----------
21 src/basic/process-util.c | 2 +-
22 src/basic/process-util.h | 2 +-
23 src/core/main.c | 4 ++--
24 src/journal/test-journal-interleaving.c | 2 +-
25 src/shared/pager.c | 2 +-
26 src/udev/collect/collect.c | 2 +-
27 9 files changed, 20 insertions(+), 21 deletions(-)
28
29 diff --git a/src/basic/log.c b/src/basic/log.c
30 index 7a7f2cb..16a2431 100644
31 --- a/src/basic/log.c
32 +++ b/src/basic/log.c
33 @@ -814,7 +814,7 @@ static void log_assert(
34 log_dispatch_internal(level, 0, file, line, func, NULL, NULL, NULL, NULL, buffer);
35 }
36
37 -noreturn void log_assert_failed_realm(
38 +_noreturn_ void log_assert_failed_realm(
39 LogRealm realm,
40 const char *text,
41 const char *file,
42 @@ -826,7 +826,7 @@ noreturn void log_assert_failed_realm(
43 abort();
44 }
45
46 -noreturn void log_assert_failed_unreachable_realm(
47 +_noreturn_ void log_assert_failed_unreachable_realm(
48 LogRealm realm,
49 const char *text,
50 const char *file,
51 diff --git a/src/basic/log.h b/src/basic/log.h
52 index efcf0f1..314be12 100644
53 --- a/src/basic/log.h
54 +++ b/src/basic/log.h
55 @@ -186,7 +186,7 @@ int log_dump_internal(
56 char *buffer);
57
58 /* Logging for various assertions */
59 -noreturn void log_assert_failed_realm(
60 +_noreturn_ void log_assert_failed_realm(
61 LogRealm realm,
62 const char *text,
63 const char *file,
64 @@ -195,7 +195,7 @@ noreturn void log_assert_failed_realm(
65 #define log_assert_failed(text, ...) \
66 log_assert_failed_realm(LOG_REALM, (text), __VA_ARGS__)
67
68 -noreturn void log_assert_failed_unreachable_realm(
69 +_noreturn_ void log_assert_failed_unreachable_realm(
70 LogRealm realm,
71 const char *text,
72 const char *file,
73 diff --git a/src/basic/macro.h b/src/basic/macro.h
74 index 89bdd85..3a6fc6f 100644
75 --- a/src/basic/macro.h
76 +++ b/src/basic/macro.h
77 @@ -53,6 +53,15 @@
78 #else
79 #define _fallthrough_
80 #endif
81 +/* Define C11 noreturn without <stdnoreturn.h> and even on older gcc
82 + * compiler versions */
83 +#ifndef _noreturn_
84 +#if __STDC_VERSION__ >= 201112L
85 +#define _noreturn_ _Noreturn
86 +#else
87 +#define _noreturn_ __attribute__((noreturn))
88 +#endif
89 +#endif
90
91 /* Temporarily disable some warnings */
92 #define DISABLE_WARNING_DECLARATION_AFTER_STATEMENT \
93 @@ -414,16 +423,6 @@ static inline unsigned long ALIGN_POWER2(unsigned long u) {
94 #endif
95 #endif
96
97 -/* Define C11 noreturn without <stdnoreturn.h> and even on older gcc
98 - * compiler versions */
99 -#ifndef noreturn
100 -#if __STDC_VERSION__ >= 201112L
101 -#define noreturn _Noreturn
102 -#else
103 -#define noreturn __attribute__((noreturn))
104 -#endif
105 -#endif
106 -
107 #define DEFINE_TRIVIAL_CLEANUP_FUNC(type, func) \
108 static inline void func##p(type *p) { \
109 if (*p) \
110 diff --git a/src/basic/process-util.c b/src/basic/process-util.c
111 index aa9846d..e6120af 100644
112 --- a/src/basic/process-util.c
113 +++ b/src/basic/process-util.c
114 @@ -987,7 +987,7 @@ bool is_main_thread(void) {
115 return cached > 0;
116 }
117
118 -noreturn void freeze(void) {
119 +_noreturn_ void freeze(void) {
120
121 log_close();
122
123 diff --git a/src/basic/process-util.h b/src/basic/process-util.h
124 index 93029e3..5170ade 100644
125 --- a/src/basic/process-util.h
126 +++ b/src/basic/process-util.h
127 @@ -91,7 +91,7 @@ int pid_from_same_root_fs(pid_t pid);
128
129 bool is_main_thread(void);
130
131 -noreturn void freeze(void);
132 +_noreturn_ void freeze(void);
133
134 bool oom_score_adjust_is_valid(int oa);
135
136 diff --git a/src/core/main.c b/src/core/main.c
137 index 076846a..4b2d149 100644
138 --- a/src/core/main.c
139 +++ b/src/core/main.c
140 @@ -141,7 +141,7 @@ static uint64_t arg_default_tasks_max = UINT64_MAX;
141 static sd_id128_t arg_machine_id = {};
142 static EmergencyAction arg_cad_burst_action = EMERGENCY_ACTION_REBOOT_FORCE;
143
144 -noreturn static void freeze_or_reboot(void) {
145 +_noreturn_ static void freeze_or_reboot(void) {
146
147 if (arg_crash_reboot) {
148 log_notice("Rebooting in 10s...");
149 @@ -156,7 +156,7 @@ noreturn static void freeze_or_reboot(void) {
150 freeze();
151 }
152
153 -noreturn static void crash(int sig) {
154 +_noreturn_ static void crash(int sig) {
155 struct sigaction sa;
156 pid_t pid;
157
158 diff --git a/src/journal/test-journal-interleaving.c b/src/journal/test-journal-interleaving.c
159 index 5a88b27..d87bdbd 100644
160 --- a/src/journal/test-journal-interleaving.c
161 +++ b/src/journal/test-journal-interleaving.c
162 @@ -37,7 +37,7 @@
163
164 static bool arg_keep = false;
165
166 -noreturn static void log_assert_errno(const char *text, int error, const char *file, int line, const char *func) {
167 +_noreturn_ static void log_assert_errno(const char *text, int error, const char *file, int line, const char *func) {
168 log_internal(LOG_CRIT, error, file, line, func,
169 "'%s' failed at %s:%u (%s): %m", text, file, line, func);
170 abort();
171 diff --git a/src/shared/pager.c b/src/shared/pager.c
172 index 75db3c9..681af9c 100644
173 --- a/src/shared/pager.c
174 +++ b/src/shared/pager.c
175 @@ -47,7 +47,7 @@ static int stored_stderr = -1;
176 static bool stdout_redirected = false;
177 static bool stderr_redirected = false;
178
179 -noreturn static void pager_fallback(void) {
180 +_noreturn_ static void pager_fallback(void) {
181 int r;
182
183 r = copy_bytes(STDIN_FILENO, STDOUT_FILENO, (uint64_t) -1, 0);
184 diff --git a/src/udev/collect/collect.c b/src/udev/collect/collect.c
185 index 2821640..c8fa47b 100644
186 --- a/src/udev/collect/collect.c
187 +++ b/src/udev/collect/collect.c
188 @@ -58,7 +58,7 @@ static inline struct _mate *node_to_mate(struct udev_list_node *node)
189 return container_of(node, struct _mate, node);
190 }
191
192 -noreturn static void sig_alrm(int signo)
193 +_noreturn_ static void sig_alrm(int signo)
194 {
195 exit(4);
196 }
197