summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/util-linux
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2015-12-19 23:37:14 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-24 09:40:27 +0000
commit3e7d7abe9161886a7c1bc732d047237ba2ff8a79 (patch)
tree92f33780ef16dcbc28879a66140c215f140985e8 /meta/recipes-core/util-linux
parent77825f8ae7656b185665e21c405015d2a052d2ed (diff)
downloadpoky-3e7d7abe9161886a7c1bc732d047237ba2ff8a79.tar.gz
util-linux: Fix ptest builds on musl
musl doesnt implement error() API, hence provide one (From OE-Core rev: 4c7cb1f34bdb030333d83e445b5df5d06bef478f) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/util-linux')
-rw-r--r--meta/recipes-core/util-linux/util-linux/uuid-test-error-api.patch92
-rw-r--r--meta/recipes-core/util-linux/util-linux_2.27.1.bb1
2 files changed, 93 insertions, 0 deletions
diff --git a/meta/recipes-core/util-linux/util-linux/uuid-test-error-api.patch b/meta/recipes-core/util-linux/util-linux/uuid-test-error-api.patch
new file mode 100644
index 0000000000..1b0ff79d42
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/uuid-test-error-api.patch
@@ -0,0 +1,92 @@
1This patch adds error() API implementation for non-glibc system C libs
2
3Upstream-Status: Pending
4Signed-off-by: Khem Raj <raj.khem@gmail.com>
5
6Index: util-linux-2.27.1/tests/helpers/test_uuidd.c
7===================================================================
8--- util-linux-2.27.1.orig/tests/helpers/test_uuidd.c
9+++ util-linux-2.27.1/tests/helpers/test_uuidd.c
10@@ -23,7 +23,6 @@
11 *
12 * make uuidd uuidgen localstatedir=/var
13 */
14-#include <error.h>
15 #include <libgen.h>
16 #include <pthread.h>
17 #include <stdio.h>
18@@ -39,6 +38,17 @@
19 #include "xalloc.h"
20 #include "strutils.h"
21
22+#ifdef __GLIBC__
23+#include <error.h>
24+#else
25+extern void (*error_print_progname)(void);
26+extern unsigned int error_message_count;
27+extern int error_one_per_line;
28+
29+void error(int, int, const char *, ...);
30+void error_at_line(int, int, const char *, unsigned int, const char *, ...);
31+#endif
32+
33 #define LOG(level,args) if (loglev >= level) { fprintf args; }
34
35 size_t nprocesses = 4;
36@@ -257,6 +267,56 @@ static void object_dump(size_t idx, obje
37 fprintf(stderr, "}\n");
38 }
39
40+#ifndef __GLIBC__
41+extern char *__progname;
42+
43+void (*error_print_progname)(void) = 0;
44+unsigned int error_message_count = 0;
45+int error_one_per_line = 0;
46+
47+static void eprint(int status, int e, const char *file, unsigned int line, const char *fmt, va_list ap)
48+{
49+ if (file && error_one_per_line) {
50+ static const char *oldfile;
51+ static unsigned int oldline;
52+ if (line == oldline && strcmp(file, oldfile) == 0)
53+ return;
54+ oldfile = file;
55+ oldline = line;
56+ }
57+ if (error_print_progname)
58+ error_print_progname();
59+ else
60+ fprintf(stderr, "%s: ", __progname);
61+ if (file)
62+ fprintf(stderr, "%s:%u: ", file, line);
63+ vfprintf(stderr, fmt, ap);
64+ if (e)
65+ fprintf(stderr, ": %s", strerror(e));
66+ putc('\n', stderr);
67+ fflush(stderr);
68+ error_message_count++;
69+ if (status)
70+ exit(status);
71+}
72+
73+void error(int status, int e, const char *fmt, ...)
74+{
75+ va_list ap;
76+ va_start(ap,fmt);
77+ eprint(status, e, 0, 0, fmt, ap);
78+ va_end(ap);
79+}
80+
81+void error_at_line(int status, int e, const char *file, unsigned int line, const char *fmt, ...)
82+{
83+ va_list ap;
84+ va_start(ap,fmt);
85+ eprint(status, e, file, line, fmt, ap);
86+ va_end(ap);
87+}
88+#endif /* __GLIBC__ */
89+
90 int main(int argc, char *argv[])
91 {
92 size_t i, nfailed = 0, nignored = 0;
diff --git a/meta/recipes-core/util-linux/util-linux_2.27.1.bb b/meta/recipes-core/util-linux/util-linux_2.27.1.bb
index 14a77ca4b2..7549158317 100644
--- a/meta/recipes-core/util-linux/util-linux_2.27.1.bb
+++ b/meta/recipes-core/util-linux/util-linux_2.27.1.bb
@@ -19,6 +19,7 @@ SRC_URI += "file://util-linux-ng-2.16-mount_lock_path.patch \
19 file://avoid_unsupported_grep_opts.patch \ 19 file://avoid_unsupported_grep_opts.patch \
20 file://display_testname_for_subtest.patch \ 20 file://display_testname_for_subtest.patch \
21 file://avoid_parallel_tests.patch \ 21 file://avoid_parallel_tests.patch \
22 file://uuid-test-error-api.patch \
22" 23"
23SRC_URI[md5sum] = "3cd2698d1363a2c64091c2dadc974647" 24SRC_URI[md5sum] = "3cd2698d1363a2c64091c2dadc974647"
24SRC_URI[sha256sum] = "0a818fcdede99aec43ffe6ca5b5388bff80d162f2f7bd4541dca94fecb87a290" 25SRC_URI[sha256sum] = "0a818fcdede99aec43ffe6ca5b5388bff80d162f2f7bd4541dca94fecb87a290"