commit: 484a73b2db981e796f1c370887fd77cfd4e14037
parent be3f3bf28e4e2002bcb9b31632b38db44b1703a3
Author: Michael Forney <mforney@mforney.org>
Date: Tue, 2 Jul 2019 20:00:52 -0700
sshfs: Fix a few portability issues
Diffstat:
4 files changed, 81 insertions(+), 1 deletion(-)
diff --git a/pkg/sshfs/patch/0010-Use-__VA_ARGS__-for-variadic-macros-arguments.patch b/pkg/sshfs/patch/0010-Use-__VA_ARGS__-for-variadic-macros-arguments.patch
@@ -0,0 +1,27 @@
+From 0b9ea41f9e4e30552ef3cce4fee512db99c4e3ed Mon Sep 17 00:00:00 2001
+From: Michael Forney <mforney@mforney.org>
+Date: Tue, 2 Jul 2019 19:50:44 -0700
+Subject: [PATCH] Use __VA_ARGS__ for variadic macros arguments
+
+---
+ sshfs.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/sshfs.c b/sshfs.c
+index d682c8f..9c65cc4 100644
+--- a/sshfs.c
++++ b/sshfs.c
+@@ -479,8 +479,8 @@ static struct fuse_opt workaround_opts[] = {
+ FUSE_OPT_END
+ };
+
+-#define DEBUG(format, args...) \
+- do { if (sshfs.debug) fprintf(stderr, format, args); } while(0)
++#define DEBUG(format, ...) \
++ do { if (sshfs.debug) fprintf(stderr, format, __VA_ARGS__); } while(0)
+
+ static const char *type_name(uint8_t type)
+ {
+--
+2.22.0
+
diff --git a/pkg/sshfs/patch/0011-Avoid-pointer-arithmetic-on-void.patch b/pkg/sshfs/patch/0011-Avoid-pointer-arithmetic-on-void.patch
@@ -0,0 +1,25 @@
+From 9d938bc129dfde5c497cc7f4b780ae4ebc6bfb81 Mon Sep 17 00:00:00 2001
+From: Michael Forney <mforney@mforney.org>
+Date: Tue, 2 Jul 2019 19:52:43 -0700
+Subject: [PATCH] Avoid pointer arithmetic on `void *`
+
+---
+ sshfs.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sshfs.c b/sshfs.c
+index 9c65cc4..c65fa73 100644
+--- a/sshfs.c
++++ b/sshfs.c
+@@ -1173,7 +1173,7 @@ static int do_write(struct iovec *iov, size_t count)
+ do {
+ if ((unsigned) res < iov->iov_len) {
+ iov->iov_len -= res;
+- iov->iov_base += res;
++ iov->iov_base = (char *) iov->iov_base + res;
+ break;
+ } else {
+ res -= iov->iov_len;
+--
+2.22.0
+
diff --git a/pkg/sshfs/patch/0012-Avoid-statement-expression-in-container_of-macro.patch b/pkg/sshfs/patch/0012-Avoid-statement-expression-in-container_of-macro.patch
@@ -0,0 +1,28 @@
+From 931911b42c5ec3ee6872a2ce2316554bca6a1af3 Mon Sep 17 00:00:00 2001
+From: Michael Forney <mforney@mforney.org>
+Date: Tue, 2 Jul 2019 19:53:34 -0700
+Subject: [PATCH] Avoid statement expression in container_of macro
+
+---
+ sshfs.c | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/sshfs.c b/sshfs.c
+index c65fa73..1532028 100644
+--- a/sshfs.c
++++ b/sshfs.c
+@@ -516,9 +516,8 @@ static const char *type_name(uint8_t type)
+ }
+ }
+
+-#define container_of(ptr, type, member) ({ \
+- const typeof( ((type *)0)->member ) *__mptr = (ptr); \
+- (type *)( (char *)__mptr - offsetof(type,member) );})
++#define container_of(ptr, type, member) ( \
++ (type *)( (char *)(ptr) - offsetof(type,member) ))
+
+ #define list_entry(ptr, type, member) \
+ container_of(ptr, type, member)
+--
+2.22.0
+
diff --git a/pkg/sshfs/ver b/pkg/sshfs/ver
@@ -1 +1 @@
-3.5.2 r0
+3.5.2 r1