view graphics/weston/musl.patch @ 1019:ddab65a5b3f5

vanilla: use /bin/busybox sh as default shell
author David Demelier <markand@malikania.fr>
date Thu, 29 Aug 2019 23:35:00 +0200
parents 7828241c9634
children
line wrap: on
line source

diff --git a/Makefile.am b/Makefile.am
index 5407b593ebb951031e79a70dda3b7dd555d1c8a9..5c6a051914a03ebe531e9c9a90b5cd199988a9a4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -230,6 +230,7 @@ libsession_helper_la_SOURCES =			\
 	libweston/launcher-util.c		\
 	libweston/launcher-util.h		\
 	libweston/launcher-impl.h		\
+	libweston/weston-error.h		\
 	libweston/weston-launch.h		\
 	libweston/launcher-weston-launch.c	\
 	libweston/launcher-direct.c
diff --git a/configure.ac b/configure.ac
index c05ad01160040a0cb30d153858bbf0247f183a57..8cfec6871e5c2c9ac0df390b47c9d22ecea88ba4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -126,6 +126,7 @@ AC_CHECK_DECL(CLOCK_MONOTONIC,[],
 	      [AC_MSG_ERROR("CLOCK_MONOTONIC is needed to compile weston")],
 	      [[#include <time.h>]])
 
+AC_CHECK_HEADERS([error.h])
 AC_CHECK_FUNCS([mkostemp strchrnul initgroups posix_fallocate])
 
 # check for libdrm as a build-time dependency only
diff --git a/libweston/weston-error.h b/libweston/weston-error.h
new file mode 100644
index 0000000000000000000000000000000000000000..bc7b95bda0a1772664d78119255b2e966cab8a15
--- /dev/null
+++ b/libweston/weston-error.h
@@ -0,0 +1,22 @@
+#ifndef _WESTON_ERROR_H
+#define _WESTON_ERROR_H
+
+#if defined(HAVE_ERROR_H)
+#include <error.h>
+#else
+#include <string.h>
+#define _weston_error(S, E, F, ...) do { \
+	if (E) { \
+		printf("\n"); \
+		fprintf(stderr, F ": %s", ##__VA_ARGS__, strerror(E)); \
+		exit(S); \
+	} else { \
+		printf("\n"); \
+		fprintf(stderr, F, ##__VA_ARGS__); \
+		exit(S); }\
+} while(0)
+
+#define error _weston_error
+#endif
+
+#endif
diff --git a/libweston/weston-launch.c b/libweston/weston-launch.c
index bf73e0d616a0d0efc228909c48bcb6b3ad6660ca..90644394309f3ee7e33bc7fafc2f3150f0a8d2b3 100644
--- a/libweston/weston-launch.c
+++ b/libweston/weston-launch.c
@@ -33,7 +33,6 @@
 #include <poll.h>
 #include <errno.h>
 
-#include <error.h>
 #include <getopt.h>
 
 #include <sys/types.h>
@@ -59,6 +58,7 @@
 #endif
 
 #include "weston-launch.h"
+#include "weston-error.h"
 
 #define DRM_MAJOR 226