summaryrefslogtreecommitdiffstats
path: root/recipes-graphics/wayland/weston/0001-make-error-portable.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-graphics/wayland/weston/0001-make-error-portable.patch')
-rw-r--r--recipes-graphics/wayland/weston/0001-make-error-portable.patch70
1 files changed, 70 insertions, 0 deletions
diff --git a/recipes-graphics/wayland/weston/0001-make-error-portable.patch b/recipes-graphics/wayland/weston/0001-make-error-portable.patch
new file mode 100644
index 00000000..f7b52843
--- /dev/null
+++ b/recipes-graphics/wayland/weston/0001-make-error-portable.patch
@@ -0,0 +1,70 @@
1From c22e90365d89346258394833cbcad03ff32b2e27 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 29 May 2015 20:56:00 -0700
4Subject: [PATCH weston] make error() portable
5
6error() is not posix but gnu extension so may not be available on all
7kind of systemsi e.g. musl.
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11Upstream-Status: Submitted
12
13 configure.ac | 2 ++
14 src/weston-error.h | 20 ++++++++++++++++++++
15 src/weston-launch.c | 2 +-
16 3 files changed, 23 insertions(+), 1 deletion(-)
17 create mode 100644 src/weston-error.h
18
19--- a/configure.ac
20+++ b/configure.ac
21@@ -60,6 +60,8 @@ AC_CHECK_DECL(CLOCK_MONOTONIC,[],
22 [[#include <time.h>]])
23 AC_CHECK_HEADERS([execinfo.h])
24
25+AC_CHECK_HEADERS([error.h])
26+
27 AC_CHECK_FUNCS([mkostemp strchrnul initgroups posix_fallocate])
28
29 COMPOSITOR_MODULES="wayland-server >= $WAYLAND_PREREQ_VERSION pixman-1 >= 0.25.2"
30--- /dev/null
31+++ b/src/weston-error.h
32@@ -0,0 +1,20 @@
33+#ifndef _WESTON_ERROR_H
34+#define _WESTON_ERROR_H
35+
36+#if defined(HAVE_ERROR_H)
37+#include <error.h>
38+#else
39+#include <err.h>
40+#include <string.h>
41+#define _weston_error(S, E, F, ...) do { \
42+ if (E) \
43+ err(S, F ": %s", ##__VA_ARGS__, strerror(E)); \
44+ else \
45+ err(S, F, ##__VA_ARGS__); \
46+} while(0)
47+
48+#define error _weston_error
49+#endif
50+
51+#endif
52+
53--- a/src/weston-launch.c
54+++ b/src/weston-launch.c
55@@ -33,7 +33,6 @@
56 #include <poll.h>
57 #include <errno.h>
58
59-#include <error.h>
60 #include <getopt.h>
61
62 #include <sys/types.h>
63@@ -59,6 +58,7 @@
64 #endif
65
66 #include "weston-launch.h"
67+#include "weston-error.h"
68
69 #define DRM_MAJOR 226
70