iodine: fix musl compatibility 1439/head
authorMaxim Storchak <m.storchak@gmail.com>
Fri, 19 Jun 2015 17:30:17 +0000 (20:30 +0300)
committerMaxim Storchak <m.storchak@gmail.com>
Thu, 25 Jun 2015 16:57:50 +0000 (19:57 +0300)
Signed-off-by: Maxim Storchak <m.storchak@gmail.com>
net/iodine/Makefile
net/iodine/patches/100-musl-compatibility.patch [new file with mode: 0644]

index af97aab588041bc1a1a3b944273bdc6ddeca5fa2..06639975781a41af39974c1ec1bd03504d5b3151 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=iodine
 PKG_VERSION:=0.7.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://code.kryo.se/iodine/
diff --git a/net/iodine/patches/100-musl-compatibility.patch b/net/iodine/patches/100-musl-compatibility.patch
new file mode 100644 (file)
index 0000000..17ddc04
--- /dev/null
@@ -0,0 +1,26 @@
+commit 9603c1848ddd4d9bb2d6ab031fcef91f543b71a0
+Author: Maxim Storchak <m.storchak@gmail.com>
+Date:   Thu Jun 25 19:38:24 2015 +0300
+
+    Fix compatibility with musl for OpenWRT
+
+    This patch breaks builds for Windows and Android, but since the only
+    libc flavors OpenWRT currently cares about are musl, uClibc and glibc,
+    this should be fine.
+
+    The reason for such brutal intrusiuon is explained in musl FAQ:
+    http://wiki.musl-libc.org/wiki/FAQ#Q:_why_is_there_no_MUSL_macro_.3F
+
+diff --git a/src/common.c b/src/common.c
+index 2715979..5f0e370 100644
+--- a/src/common.c
++++ b/src/common.c
+@@ -57,7 +57,7 @@
+ const unsigned char raw_header[RAW_HDR_LEN] = { 0x10, 0xd1, 0x9e, 0x00 };
+ /* daemon(3) exists only in 4.4BSD or later, and in GNU libc */
+-#if !defined(ANDROID) && !defined(WINDOWS32) && !(defined(BSD) && (BSD >= 199306)) && !defined(__GLIBC__)
++#ifdef __UCLIBC__
+ static int daemon(int nochdir, int noclose)
+ {
+       int fd, i;