1 From 7f41ef32c8c887ee23ca83da4dfd7a4f27e01186 Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 Date: Wed, 10 Feb 2016 23:09:51 +0100
4 Subject: [PATCH] sysdep.h: don't assume <error.h> is available on all Linux
7 The current logic in sysdep.h assumes that whenever you have __linux__
8 or __GLIBC__ defined, then <error.h> functionality is
9 available. However, the <error.h> functionality is a glibc-ism, not
10 available in more standard-conformant C libraries such as the musl C
11 library. With musl, __linux__ is defined (but of course not
12 __GLIBC__). With the current logic, sysdep.h assumes that <error.h> is
13 available, which isn't the case.
15 This patch therefore changes the logic to only use <error.h> when
16 __GLIBC__ is defined. It fixes the following build error:
18 In file included from tunip.c:87:0:
19 sysdep.h:41:19: fatal error: error.h: No such file or directory
23 http://git.alpinelinux.org/cgit/aports/tree/testing/vpnc/working.patch.
25 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
28 1 file changed, 4 insertions(+), 1 deletion(-)
30 diff --git a/sysdep.h b/sysdep.h
31 index 137bf6d..fb65b31 100644
34 @@ -38,11 +38,14 @@ int tun_get_hwaddr(int fd, char *dev, uint8_t *hwaddr);
36 /***************************************************************************/
37 #if defined(__linux__) || defined(__GLIBC__)
44 #define HAVE_VASPRINTF 1
45 #define HAVE_ASPRINTF 1
47 #define HAVE_UNSETENV 1