aboutsummaryrefslogtreecommitdiffstats
path: root/net/netatalk
diff options
context:
space:
mode:
authormarcus <marcus@FreeBSD.org>2012-04-29 08:48:35 +0800
committermarcus <marcus@FreeBSD.org>2012-04-29 08:48:35 +0800
commit74432265118ffb304942f7afeeafe89b65036f6e (patch)
tree2969d997c36f33a454025b61c6dc897216e45719 /net/netatalk
parent74437b92206efd75bcb3b185a78b0d775f5f5c85 (diff)
downloadfreebsd-ports-graphics-74432265118ffb304942f7afeeafe89b65036f6e.tar.gz
freebsd-ports-graphics-74432265118ffb304942f7afeeafe89b65036f6e.tar.zst
freebsd-ports-graphics-74432265118ffb304942f7afeeafe89b65036f6e.zip
Fix usage of sendfile on FreeBSD.
PR: 167380 Submitted by: Daniel Becker <razzfazz@gmail.com> Obtained from: netatalk git
Diffstat (limited to 'net/netatalk')
-rw-r--r--net/netatalk/files/patch-libatalk_adouble_ad_sendfile.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/net/netatalk/files/patch-libatalk_adouble_ad_sendfile.c b/net/netatalk/files/patch-libatalk_adouble_ad_sendfile.c
new file mode 100644
index 00000000000..97437a84584
--- /dev/null
+++ b/net/netatalk/files/patch-libatalk_adouble_ad_sendfile.c
@@ -0,0 +1,20 @@
+--- libatalk/adouble/ad_sendfile.c.orig 2011-12-05 13:28:30.000000000 +0000
++++ libatalk/adouble/ad_sendfile.c 2012-04-29 00:47:10.375795000 +0000
+@@ -67,7 +67,16 @@ ssize_t sys_sendfile(int tofd, int fromf
+ #include <sys/uio.h>
+ ssize_t sys_sendfile(int tofd, int fromfd, off_t *offset, size_t count)
+ {
+- return sendfile(fromfd, tofd, *offset, count, NULL, offset, 0);
++ off_t len;
++ int ret;
++
++ ret = sendfile(fromfd, tofd, *offset, count, NULL, &len, 0);
++
++ *offset += len;
++
++ if (ret != 0)
++ return -1;
++ return len;
+ }
+
+ #else