summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/systemd/systemd/0002-don-t-use-glibc-specific-qsort_r.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/systemd/systemd/0002-don-t-use-glibc-specific-qsort_r.patch')
-rw-r--r--meta/recipes-core/systemd/systemd/0002-don-t-use-glibc-specific-qsort_r.patch39
1 files changed, 19 insertions, 20 deletions
diff --git a/meta/recipes-core/systemd/systemd/0002-don-t-use-glibc-specific-qsort_r.patch b/meta/recipes-core/systemd/systemd/0002-don-t-use-glibc-specific-qsort_r.patch
index 36e0699da9..c6213ab88e 100644
--- a/meta/recipes-core/systemd/systemd/0002-don-t-use-glibc-specific-qsort_r.patch
+++ b/meta/recipes-core/systemd/systemd/0002-don-t-use-glibc-specific-qsort_r.patch
@@ -8,20 +8,23 @@ Upstream-Status: Inappropriate [musl specific]
8Signed-off-by: Khem Raj <raj.khem@gmail.com> 8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9[Rebased for v241] 9[Rebased for v241]
10Signed-off-by: Chen Qi <Qi.Chen@windriver.com> 10Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
11[Rebased for v242]
12Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
11--- 13---
12 src/basic/util.h | 14 -------------- 14 src/basic/sort-util.h | 14 --------------
13 src/libsystemd/sd-hwdb/hwdb-util.c | 19 ++++++++++++++----- 15 src/libsystemd/sd-hwdb/hwdb-util.c | 19 ++++++++++++++-----
14 src/shared/format-table.c | 36 ++++++++++++++++++++++++------------ 16 src/shared/format-table.c | 36 ++++++++++++++++++++++++------------
15 3 files changed, 38 insertions(+), 31 deletions(-) 17 3 files changed, 38 insertions(+), 31 deletions(-)
16 18
17diff --git a/src/basic/util.h b/src/basic/util.h 19diff --git a/src/basic/sort-util.h b/src/basic/sort-util.h
18index dc33d66..9f6a6ce 100644 20index e029f8646e..27d68b341c 100644
19--- a/src/basic/util.h 21--- a/src/basic/sort-util.h
20+++ b/src/basic/util.h 22+++ b/src/basic/sort-util.h
21@@ -116,20 +116,6 @@ static inline void qsort_safe(void *base, size_t nmemb, size_t size, __compar_fn 23@@ -54,17 +54,3 @@ static inline void qsort_safe(void *base, size_t nmemb, size_t size, __compar_fn
24 int (*_func_)(const typeof(p[0])*, const typeof(p[0])*) = func; \
22 qsort_safe((p), (n), sizeof((p)[0]), (__compar_fn_t) _func_); \ 25 qsort_safe((p), (n), sizeof((p)[0]), (__compar_fn_t) _func_); \
23 }) 26 })
24 27-
25-static inline void qsort_r_safe(void *base, size_t nmemb, size_t size, __compar_d_fn_t compar, void *userdata) { 28-static inline void qsort_r_safe(void *base, size_t nmemb, size_t size, __compar_d_fn_t compar, void *userdata) {
26- if (nmemb <= 1) 29- if (nmemb <= 1)
27- return; 30- return;
@@ -35,15 +38,11 @@ index dc33d66..9f6a6ce 100644
35- int (*_func_)(const typeof(p[0])*, const typeof(p[0])*, typeof(userdata)) = func; \ 38- int (*_func_)(const typeof(p[0])*, const typeof(p[0])*, typeof(userdata)) = func; \
36- qsort_r_safe((p), (n), sizeof((p)[0]), (__compar_d_fn_t) _func_, userdata); \ 39- qsort_r_safe((p), (n), sizeof((p)[0]), (__compar_d_fn_t) _func_, userdata); \
37- }) 40- })
38-
39 /* Normal memcpy requires src to be nonnull. We do nothing if n is 0. */
40 static inline void memcpy_safe(void *dst, const void *src, size_t n) {
41 if (n == 0)
42diff --git a/src/libsystemd/sd-hwdb/hwdb-util.c b/src/libsystemd/sd-hwdb/hwdb-util.c 41diff --git a/src/libsystemd/sd-hwdb/hwdb-util.c b/src/libsystemd/sd-hwdb/hwdb-util.c
43index f852967..b570ce1 100644 42index c83575c7c8..72f8f3a050 100644
44--- a/src/libsystemd/sd-hwdb/hwdb-util.c 43--- a/src/libsystemd/sd-hwdb/hwdb-util.c
45+++ b/src/libsystemd/sd-hwdb/hwdb-util.c 44+++ b/src/libsystemd/sd-hwdb/hwdb-util.c
46@@ -126,9 +126,13 @@ static void trie_free(struct trie *trie) { 45@@ -128,9 +128,13 @@ static void trie_free(struct trie *trie) {
47 46
48 DEFINE_TRIVIAL_CLEANUP_FUNC(struct trie*, trie_free); 47 DEFINE_TRIVIAL_CLEANUP_FUNC(struct trie*, trie_free);
49 48
@@ -60,7 +59,7 @@ index f852967..b570ce1 100644
60 } 59 }
61 60
62 static int trie_node_add_value(struct trie *trie, struct trie_node *node, 61 static int trie_node_add_value(struct trie *trie, struct trie_node *node,
63@@ -156,7 +160,10 @@ static int trie_node_add_value(struct trie *trie, struct trie_node *node, 62@@ -158,7 +162,10 @@ static int trie_node_add_value(struct trie *trie, struct trie_node *node,
64 .value_off = v, 63 .value_off = v,
65 }; 64 };
66 65
@@ -72,7 +71,7 @@ index f852967..b570ce1 100644
72 if (val) { 71 if (val) {
73 /* At this point we have 2 identical properties on the same match-string. 72 /* At this point we have 2 identical properties on the same match-string.
74 * Since we process files in order, we just replace the previous value. */ 73 * Since we process files in order, we just replace the previous value. */
75@@ -182,7 +189,9 @@ static int trie_node_add_value(struct trie *trie, struct trie_node *node, 74@@ -184,7 +191,9 @@ static int trie_node_add_value(struct trie *trie, struct trie_node *node,
76 .line_number = line_number, 75 .line_number = line_number,
77 }; 76 };
78 node->values_count++; 77 node->values_count++;
@@ -84,10 +83,10 @@ index f852967..b570ce1 100644
84 } 83 }
85 84
86diff --git a/src/shared/format-table.c b/src/shared/format-table.c 85diff --git a/src/shared/format-table.c b/src/shared/format-table.c
87index 7d52980..75dbfe1 100644 86index a5c0a99b08..d595cbe372 100644
88--- a/src/shared/format-table.c 87--- a/src/shared/format-table.c
89+++ b/src/shared/format-table.c 88+++ b/src/shared/format-table.c
90@@ -848,31 +848,33 @@ static int cell_data_compare(TableData *a, size_t index_a, TableData *b, size_t 89@@ -850,31 +850,33 @@ static int cell_data_compare(TableData *a, size_t index_a, TableData *b, size_t
91 return CMP(index_a, index_b); 90 return CMP(index_a, index_b);
92 } 91 }
93 92
@@ -131,7 +130,7 @@ index 7d52980..75dbfe1 100644
131 } 130 }
132 131
133 /* Order identical lines by the order there were originally added in */ 132 /* Order identical lines by the order there were originally added in */
134@@ -1105,7 +1107,12 @@ int table_print(Table *t, FILE *f) { 133@@ -1107,7 +1109,12 @@ int table_print(Table *t, FILE *f) {
135 for (i = 0; i < n_rows; i++) 134 for (i = 0; i < n_rows; i++)
136 sorted[i] = i * t->n_columns; 135 sorted[i] = i * t->n_columns;
137 136
@@ -145,7 +144,7 @@ index 7d52980..75dbfe1 100644
145 } 144 }
146 145
147 if (t->display_map) 146 if (t->display_map)
148@@ -1532,7 +1539,12 @@ int table_to_json(Table *t, JsonVariant **ret) { 147@@ -1534,7 +1541,12 @@ int table_to_json(Table *t, JsonVariant **ret) {
149 for (i = 0; i < n_rows; i++) 148 for (i = 0; i < n_rows; i++)
150 sorted[i] = i * t->n_columns; 149 sorted[i] = i * t->n_columns;
151 150
@@ -160,5 +159,5 @@ index 7d52980..75dbfe1 100644
160 159
161 if (t->display_map) 160 if (t->display_map)
162-- 161--
1632.7.4 1622.11.0
164 163