summaryrefslogtreecommitdiff
path: root/sysutils/zbackup/files/patch-file.cc
diff options
context:
space:
mode:
authorKevin Lo <kevlo@FreeBSD.org>2015-06-23 05:25:17 +0000
committerKevin Lo <kevlo@FreeBSD.org>2015-06-23 05:25:17 +0000
commitbd73db2bd556c6bba53fe453199b7526f422fd2c (patch)
tree40b8cb0371e619abaab74507dca10b7e233ffc4d /sysutils/zbackup/files/patch-file.cc
parent- Always use USE_RC_SUBR now that it handles properly PREFIX=/usr (diff)
Update to 1.4.1
Notes
Notes: svn path=/head/; revision=390350
Diffstat (limited to 'sysutils/zbackup/files/patch-file.cc')
-rw-r--r--sysutils/zbackup/files/patch-file.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/sysutils/zbackup/files/patch-file.cc b/sysutils/zbackup/files/patch-file.cc
new file mode 100644
index 000000000000..81e6d8928588
--- /dev/null
+++ b/sysutils/zbackup/files/patch-file.cc
@@ -0,0 +1,21 @@
+--- file.cc.orig 2014-12-16 20:32:29.000000000 +0800
++++ file.cc 2015-06-23 13:16:37.741129000 +0800
+@@ -6,7 +6,7 @@
+ #include <unistd.h>
+ #include <cerrno>
+ #include <cstring>
+-#ifdef __APPLE__
++#if defined(__APPLE_) || defined(__FreeBSD__)
+ #include <sys/socket.h>
+ #else
+ #include <sys/sendfile.h>
+@@ -67,6 +67,9 @@
+ #ifdef __APPLE__
+ if ( -1 == sendfile(write_fd, read_fd, offset, &stat_buf.st_size, NULL, 0) )
+ throw exCantRename( from + " to " + to );
++ #elif defined(__FreeBSD__)
++ if ( -1 == sendfile(write_fd, read_fd, offset, stat_buf.st_size, NULL, NULL, 0) )
++ throw exCantRename( from + " to " + to );
+ #else
+ if ( -1 == sendfile(write_fd, read_fd, &offset, stat_buf.st_size) )
+ throw exCantRename( from + " to " + to );