Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions meta-oe/recipes-core/sdbus-c++/sdbus-c++-0.7.6/run-ptest
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh
set -e
set -o pipefail

SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"

${SCRIPTPATH}/../tests/sdbus-c++-unit-tests 2>&1 | \
sed -r 's/^\[\s+OK\s+\] (.*) \([0-9]+\sms\)$/OK: \1 /' | \
sed -r 's/^\[\s+FAILED\s+\] (.*) \([0-9]+\sms\)$/FAILED: \1 /' | \
awk '{if ($1 == "OK:" || $1 == "FAILED:") {print $0}}'

${SCRIPTPATH}/../tests/sdbus-c++-integration-tests 2>&1 | \
sed -r 's/^\[\s+OK\s+\] (.*) \([0-9]+\sms\)$/OK: \1 /' | \
sed -r 's/^\[\s+FAILED\s+\] (.*) \([0-9]+\sms\)$/FAILED: \1 /' | \
awk '{if ($1 == "OK:" || $1 == "FAILED:") {print $0}}'

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
From 1eb84534dea05d41afed1d898cba212ad7d310dd Mon Sep 17 00:00:00 2001
From: Chen Qi <Qi.Chen@windriver.com>
Date: Mon, 25 Feb 2019 13:41:41 +0800
Subject: [PATCH 02/24] don't use glibc-specific qsort_r

Upstream-Status: Inappropriate [musl specific]

Signed-off-by: Khem Raj <raj.khem@gmail.com>
[Rebased for v241]
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
[Rebased for v242]
Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
---
src/basic/sort-util.h | 14 --------------
src/libsystemd/sd-hwdb/hwdb-util.c | 19 ++++++++++++++-----
src/shared/format-table.c | 36 ++++++++++++++++++++++++------------
3 files changed, 38 insertions(+), 31 deletions(-)

diff --git a/src/basic/sort-util.h b/src/basic/sort-util.h
index e029f8646e..27d68b341c 100644
--- a/src/basic/sort-util.h
+++ b/src/basic/sort-util.h
@@ -54,17 +54,3 @@ static inline void qsort_safe(void *base, size_t nmemb, size_t size, __compar_fn
int (*_func_)(const typeof(p[0])*, const typeof(p[0])*) = func; \
qsort_safe((p), (n), sizeof((p)[0]), (__compar_fn_t) _func_); \
})
-
-static inline void qsort_r_safe(void *base, size_t nmemb, size_t size, __compar_d_fn_t compar, void *userdata) {
- if (nmemb <= 1)
- return;
-
- assert(base);
- qsort_r(base, nmemb, size, compar, userdata);
-}
-
-#define typesafe_qsort_r(p, n, func, userdata) \
- ({ \
- int (*_func_)(const typeof(p[0])*, const typeof(p[0])*, typeof(userdata)) = func; \
- qsort_r_safe((p), (n), sizeof((p)[0]), (__compar_d_fn_t) _func_, userdata); \
- })
diff --git a/src/libsystemd/sd-hwdb/hwdb-util.c b/src/libsystemd/sd-hwdb/hwdb-util.c
index c83575c7c8..72f8f3a050 100644
--- a/src/libsystemd/sd-hwdb/hwdb-util.c
+++ b/src/libsystemd/sd-hwdb/hwdb-util.c
@@ -128,9 +128,13 @@ static void trie_free(struct trie *trie) {

DEFINE_TRIVIAL_CLEANUP_FUNC(struct trie*, trie_free);

-static int trie_values_cmp(const struct trie_value_entry *a, const struct trie_value_entry *b, struct trie *trie) {
- return strcmp(trie->strings->buf + a->key_off,
- trie->strings->buf + b->key_off);
+static struct trie *trie_node_add_value_trie;
+static int trie_values_cmp(const void *v1, const void *v2) {
+ const struct trie_value_entry *a = v1;
+ const struct trie_value_entry *b = v2;
+
+ return strcmp(trie_node_add_value_trie->strings->buf + a->key_off,
+ trie_node_add_value_trie->strings->buf + b->key_off);
}

static int trie_node_add_value(struct trie *trie, struct trie_node *node,
@@ -158,7 +162,10 @@ static int trie_node_add_value(struct trie *trie, struct trie_node *node,
.value_off = v,
};

- val = typesafe_bsearch_r(&search, node->values, node->values_count, trie_values_cmp, trie);
+ trie_node_add_value_trie = trie;
+ val = bsearch(&search, node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp);
+ trie_node_add_value_trie = NULL;
+
if (val) {
/* At this point we have 2 identical properties on the same match-string.
* Since we process files in order, we just replace the previous value. */
@@ -184,7 +191,9 @@ static int trie_node_add_value(struct trie *trie, struct trie_node *node,
.line_number = line_number,
};
node->values_count++;
- typesafe_qsort_r(node->values, node->values_count, trie_values_cmp, trie);
+ trie_node_add_value_trie = trie;
+ qsort(node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp);
+ trie_node_add_value_trie = NULL;
return 0;
}

diff --git a/src/shared/format-table.c b/src/shared/format-table.c
index a5c0a99b08..d595cbe372 100644
--- a/src/shared/format-table.c
+++ b/src/shared/format-table.c
@@ -850,31 +850,33 @@ static int cell_data_compare(TableData *a, size_t index_a, TableData *b, size_t
return CMP(index_a, index_b);
}

-static int table_data_compare(const size_t *a, const size_t *b, Table *t) {
+static Table *user_table;
+static int table_data_compare(const void *x, const void *y) {
+ const size_t *a = x, *b=y;
size_t i;
int r;

- assert(t);
- assert(t->sort_map);
+ assert(user_table);
+ assert(user_table->sort_map);

/* Make sure the header stays at the beginning */
- if (*a < t->n_columns && *b < t->n_columns)
+ if (*a < user_table->n_columns && *b < user_table->n_columns)
return 0;
- if (*a < t->n_columns)
+ if (*a < user_table->n_columns)
return -1;
- if (*b < t->n_columns)
+ if (*b < user_table->n_columns)
return 1;

/* Order other lines by the sorting map */
- for (i = 0; i < t->n_sort_map; i++) {
+ for (i = 0; i < user_table->n_sort_map; i++) {
TableData *d, *dd;

- d = t->data[*a + t->sort_map[i]];
- dd = t->data[*b + t->sort_map[i]];
+ d = user_table->data[*a + user_table->sort_map[i]];
+ dd = user_table->data[*b + user_table->sort_map[i]];

r = cell_data_compare(d, *a, dd, *b);
if (r != 0)
- return t->reverse_map && t->reverse_map[t->sort_map[i]] ? -r : r;
+ return user_table->reverse_map && user_table->reverse_map[user_table->sort_map[i]] ? -r : r;
}

/* Order identical lines by the order there were originally added in */
@@ -1107,7 +1109,12 @@ int table_print(Table *t, FILE *f) {
for (i = 0; i < n_rows; i++)
sorted[i] = i * t->n_columns;

- typesafe_qsort_r(sorted, n_rows, table_data_compare, t);
+ if (n_rows <= 1)
+ return 0;
+ assert(sorted);
+ user_table = t;
+ qsort(sorted, n_rows, sizeof(size_t), table_data_compare);
+ user_table = NULL;
}

if (t->display_map)
@@ -1534,7 +1541,12 @@ int table_to_json(Table *t, JsonVariant **ret) {
for (i = 0; i < n_rows; i++)
sorted[i] = i * t->n_columns;

- typesafe_qsort_r(sorted, n_rows, table_data_compare, t);
+ if (n_rows <= 1)
+ return 0;
+ assert(sorted);
+ user_table = t;
+ qsort(sorted, n_rows, sizeof(size_t), table_data_compare);
+ user_table = NULL;
}

if (t->display_map)
--
2.11.0

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Include sys/wait.h

Fixes:
src/login/logind-brightness.c:158:85: error: 'WEXITED' undeclared (first use in this function); did you mean 'WIFEXITED'?
158 | r = sd_event_add_child(w->manager->event, &w->child_event_source, w->child, WEXITED, on_brightness_writer_exit, w);
| ^~~~~~~

Upstream-Status: Pending

Signed-off-by: Scott Murray <scott.murray@konsulko.com>
---
src/login/logind-brightness.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/src/login/logind-brightness.c b/src/login/logind-brightness.c
index 8dfa97d7ae..bddd4a2727 100644
--- a/src/login/logind-brightness.c
+++ b/src/login/logind-brightness.c
@@ -1,5 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */

+#include <sys/wait.h>
#include "bus-util.h"
#include "device-util.h"
#include "hash-funcs.h"
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
From a9421d55102fc84f77f7c21a2479fcd00652b896 Mon Sep 17 00:00:00 2001
From: Chen Qi <Qi.Chen@windriver.com>
Date: Mon, 25 Feb 2019 13:55:12 +0800
Subject: [PATCH 03/24] missing_type.h: add __compare_fn_t and comparison_fn_t

Make it work with musl where comparison_fn_t and __compare_fn_t
is not provided.

Upstream-Status: Inappropriate [musl specific]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
[Rebased for v242]
Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
---
src/basic/missing_type.h | 9 +++++++++
src/basic/sort-util.h | 1 +
src/journal/catalog.c | 1 +
3 files changed, 11 insertions(+)

diff --git a/src/basic/missing_type.h b/src/basic/missing_type.h
index bf8a6caa1b..2134fe5095 100644
--- a/src/basic/missing_type.h
+++ b/src/basic/missing_type.h
@@ -10,3 +10,12 @@
#if !HAVE_CHAR16_T
#define char16_t uint16_t
#endif
+
+#ifndef __GLIBC__
+typedef int (*comparison_fn_t)(const void *, const void *);
+#endif
+
+#ifndef __COMPAR_FN_T
+#define __COMPAR_FN_T
+typedef int (*__compar_fn_t)(const void *, const void *);
+#endif
diff --git a/src/basic/sort-util.h b/src/basic/sort-util.h
index e029f86..7247d40 100644
--- a/src/basic/sort-util.h
+++ b/src/basic/sort-util.h
@@ -4,6 +4,7 @@
#include <stdlib.h>

#include "macro.h"
+#include "missing.h"

void *xbsearch_r(const void *key, const void *base, size_t nmemb, size_t size,
__compar_d_fn_t compar, void *arg);
diff --git a/src/journal/catalog.c b/src/journal/catalog.c
index 7beffc1e1a..4818a2e5cc 100644
--- a/src/journal/catalog.c
+++ b/src/journal/catalog.c
@@ -29,6 +29,7 @@
#include "string-util.h"
#include "strv.h"
#include "tmpfile-util.h"
+#include "missing.h"

const char * const catalog_file_dirs[] = {
"/usr/local/lib/systemd/catalog/",
--
2.11.0

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Include signal.h

Fixes several signal set related errors:
src/basic/copy.c:92:19: error: implicit declaration of function 'sigemptyset' [-Werror=implicit-function-declaration]
src/basic/copy.c:93:19: error: implicit declaration of function 'sigaddset' [-Werror=implicit-function-declaration]
src/basic/copy.c:93:34: error: 'SIGINT' undeclared (first use in this function)
src/basic/copy.c:95:13: error: implicit declaration of function 'sigtimedwait' [-Werror=implicit-function-declaration]

Upstream-Status: Pending

Signed-off-by: Scott Murray <scott.murray@konsulko.com>
---
src/basic/copy.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/src/basic/copy.c b/src/basic/copy.c
index ca311e021e..3cf7fc1697 100644
--- a/src/basic/copy.c
+++ b/src/basic/copy.c
@@ -12,6 +12,7 @@
#include <sys/xattr.h>
#include <time.h>
#include <unistd.h>
+#include <signal.h>

#include "alloc-util.h"
#include "btrfs-util.h"
Loading