diff mbox series

[oe,meta-filesystems,1/6] unionfs-fuse: Fix build with musl

Message ID 20170714183456.22548-1-raj.khem@gmail.com
State Accepted
Commit e16fef4f4d1ea2ec0fab8d0f3c898e4fcc687343
Headers show
Series [oe,meta-filesystems,1/6] unionfs-fuse: Fix build with musl | expand

Commit Message

Khem Raj July 14, 2017, 6:34 p.m. UTC
Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
 ...1-unionfs-Define-IOCPARM_LEN-if-undefined.patch | 62 ++++++++++++++++++++++
 .../unionfs-fuse/unionfs-fuse_2.0.bb               |  3 +-
 2 files changed, 64 insertions(+), 1 deletion(-)
 create mode 100644 meta-filesystems/recipes-filesystems/unionfs-fuse/files/0001-unionfs-Define-IOCPARM_LEN-if-undefined.patch

-- 
2.13.3

-- 
_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
diff mbox series

Patch

diff --git a/meta-filesystems/recipes-filesystems/unionfs-fuse/files/0001-unionfs-Define-IOCPARM_LEN-if-undefined.patch b/meta-filesystems/recipes-filesystems/unionfs-fuse/files/0001-unionfs-Define-IOCPARM_LEN-if-undefined.patch
new file mode 100644
index 000000000..8f991cd3f
--- /dev/null
+++ b/meta-filesystems/recipes-filesystems/unionfs-fuse/files/0001-unionfs-Define-IOCPARM_LEN-if-undefined.patch
@@ -0,0 +1,62 @@ 
+From 10411fa8658621822ae394160daffaced4a4cd7f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 13 Jul 2017 23:07:29 -0700
+Subject: [PATCH] unionfs: Define IOCPARM_LEN if undefined
+
+musl does not have sysctl.h which defines this
+for glibc
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/unionfs.c |  8 --------
+ src/unionfs.h | 15 +++++++++++++++
+ 2 files changed, 15 insertions(+), 8 deletions(-)
+
+diff --git a/src/unionfs.c b/src/unionfs.c
+index a34d34e..51684a7 100644
+--- a/src/unionfs.c
++++ b/src/unionfs.c
+@@ -21,14 +21,6 @@
+ #include "opts.h"
+ #include "usyslog.h"
+ 
+-#ifndef _IOC_SIZE
+-#ifdef IOCPARM_LEN
+-#define _IOC_SIZE(x) IOCPARM_LEN(x)
+-#else
+-#error "No mechanism for determining ioctl length found."
+-#endif
+-#endif
+-
+ static struct fuse_opt unionfs_opts[] = {
+ 	FUSE_OPT_KEY("chroot=%s,", KEY_CHROOT),
+ 	FUSE_OPT_KEY("cow", KEY_COW),
+diff --git a/src/unionfs.h b/src/unionfs.h
+index 8f5e0bf..b02de5a 100644
+--- a/src/unionfs.h
++++ b/src/unionfs.h
+@@ -17,6 +17,21 @@
+ #define FUSE_META_FILE ".fuse_hidden"
+ #define FUSE_META_LENGTH 12
+ 
++#ifndef IOCPARM_MASK
++#define IOCPARM_MASK      0x1FFF
++#endif
++#ifndef IOCPARM_LEN
++#define IOCPARM_LEN(a)    (((a) >> 16) & IOCPARM_MASK)
++#endif
++
++#ifndef _IOC_SIZE
++#ifdef IOCPARM_LEN
++#define _IOC_SIZE(x) IOCPARM_LEN(x)
++#else
++#error "No mechanism for determining ioctl length found."
++#endif
++#endif
++
+ // file access protection mask
+ #define S_PROT_MASK (S_ISUID| S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO)
+ 
+-- 
+2.13.2
+
diff --git a/meta-filesystems/recipes-filesystems/unionfs-fuse/unionfs-fuse_2.0.bb b/meta-filesystems/recipes-filesystems/unionfs-fuse/unionfs-fuse_2.0.bb
index b89d8db15..6bedf16b0 100644
--- a/meta-filesystems/recipes-filesystems/unionfs-fuse/unionfs-fuse_2.0.bb
+++ b/meta-filesystems/recipes-filesystems/unionfs-fuse/unionfs-fuse_2.0.bb
@@ -8,7 +8,8 @@  LIC_FILES_CHKSUM = "file://src/unionfs.c;beginline=3;endline=8;md5=30fa8de70fd8a
 
 SRC_URI = "git://github.com/rpodgorny/${BPN}.git;branch=master \
            file://0001-support-cross-compiling.patch \
-"
+           file://0001-unionfs-Define-IOCPARM_LEN-if-undefined.patch \
+           "
 SRCREV = "c8d23a9a75f1a62988593671839e8a168a79f3e5"
 
 DEPENDS = "fuse"