Fix usage of sendfile on FreeBSD.
PR: 167380 Submitted by: Daniel Becker <razzfazz@gmail.com> Obtained from: netatalk git
This commit is contained in:
parent
dcc67b2d4f
commit
b593c7b4d7
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=295661
1 changed files with 20 additions and 0 deletions
20
net/netatalk/files/patch-libatalk_adouble_ad_sendfile.c
Normal file
20
net/netatalk/files/patch-libatalk_adouble_ad_sendfile.c
Normal file
|
@ -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
|
Loading…
Reference in a new issue