mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 15:38:40 +01:00
vpnc: fix musl compatibility
- Add missing `sys/ttydefaults.h` include to `config.c` - Restrict usage of `error.h` to glibc and uclibc only - Avoid including `linux/if_tun.h` on non-glibc/uclibc to prevent musl kernel/libc header conflicts Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
--- a/sysdep.h
|
||||
+++ b/sysdep.h
|
||||
@@ -37,12 +37,14 @@ int tun_read(int fd, unsigned char *buf,
|
||||
int tun_get_hwaddr(int fd, char *dev, uint8_t *hwaddr);
|
||||
|
||||
/***************************************************************************/
|
||||
-#if defined(__linux__) || defined(__GLIBC__)
|
||||
+#if defined(__GLIBC__) || defined(__UCLIBC__)
|
||||
#include <error.h>
|
||||
+#define HAVE_ERROR 1
|
||||
+#endif
|
||||
|
||||
+#if defined(__linux__) || defined(__GLIBC__)
|
||||
#define HAVE_VASPRINTF 1
|
||||
#define HAVE_ASPRINTF 1
|
||||
-#define HAVE_ERROR 1
|
||||
#define HAVE_UNSETENV 1
|
||||
#define HAVE_SETENV 1
|
||||
#endif
|
||||
--- a/sysdep.c
|
||||
+++ b/sysdep.c
|
||||
@@ -59,7 +59,9 @@
|
||||
#if defined(__DragonFly__)
|
||||
#include <net/tun/if_tun.h>
|
||||
#elif defined(__linux__)
|
||||
-#include <linux/if_tun.h>
|
||||
+# if defined(__GLIBC__) || defined(__UCLIBC__)
|
||||
+# include <linux/if_tun.h>
|
||||
+# endif
|
||||
#elif defined(__APPLE__)
|
||||
/* no header for tun */
|
||||
#elif defined(__CYGWIN__)
|
||||
--- a/config.c
|
||||
+++ b/config.c
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
+#include <sys/ttydefaults.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/utsname.h>
|
||||
#include <sys/wait.h>
|
||||
Reference in New Issue
Block a user