From b593c7b4d7860d6ebbf8c2b58aba06b67871e2ca Mon Sep 17 00:00:00 2001 From: Joe Marcus Clarke Date: Sun, 29 Apr 2012 00:48:35 +0000 Subject: [PATCH] Fix usage of sendfile on FreeBSD. PR: 167380 Submitted by: Daniel Becker Obtained from: netatalk git --- .../patch-libatalk_adouble_ad_sendfile.c | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 net/netatalk/files/patch-libatalk_adouble_ad_sendfile.c 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 000000000000..97437a845846 --- /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 + 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