diff options
author | jmd <jmd@FreeBSD.org> | 2018-11-13 15:03:15 +0800 |
---|---|---|
committer | jmd <jmd@FreeBSD.org> | 2018-11-13 15:03:15 +0800 |
commit | a0ba4632b450cc92eec4d6238114e79801b552b1 (patch) | |
tree | f2e72a14bcb2faac5f40d0ec599ca7e9ffeba9a1 /biology/molden/files/patch-xwin.c | |
parent | ddf010c6d8660f3e739d7bcac17aeefbebbd83d7 (diff) | |
download | freebsd-ports-gnome-a0ba4632b450cc92eec4d6238114e79801b552b1.tar.gz freebsd-ports-gnome-a0ba4632b450cc92eec4d6238114e79801b552b1.tar.zst freebsd-ports-gnome-a0ba4632b450cc92eec4d6238114e79801b552b1.zip |
biology/molden: update to 5.8.2
Also add do-install-{option}-on targets and shadow ${MKDIR} commands.
PR: 233060
Submitted by: yuri
Diffstat (limited to 'biology/molden/files/patch-xwin.c')
-rw-r--r-- | biology/molden/files/patch-xwin.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/biology/molden/files/patch-xwin.c b/biology/molden/files/patch-xwin.c new file mode 100644 index 000000000000..482160e326b6 --- /dev/null +++ b/biology/molden/files/patch-xwin.c @@ -0,0 +1,32 @@ +--- xwin.c.orig 2018-11-07 12:54:20 UTC ++++ xwin.c +@@ -4218,8 +4218,12 @@ void makeRasterFont(Display *dpy); + #include <math.h> + + #include <fcntl.h> +-#if defined(__APPLE__) || defined(__FreeBSD__) ++#if defined(__APPLE__) + #include <copyfile.h> ++#elif defined(__FreeBSD__) ++#include <sys/types.h> ++#include <sys/socket.h> ++#include <sys/uio.h> + #else + #include <sys/sendfile.h> + #endif +@@ -4238,9 +4242,14 @@ int OSCopyFile(const char* source, const + } + + //Here we use kernel-space copying for performance reasons +-#if defined(__APPLE__) || defined(__FreeBSD__) ++#if defined(__APPLE__) + //fcopyfile works on FreeBSD and OS X 10.5+ + int result = fcopyfile(input, output, 0, COPYFILE_ALL); ++#elif defined(__FreeBSD__) ++ off_t bytesCopied = 0; ++ struct stat fileinfo = {0}; ++ fstat(input, &fileinfo); ++ int result = sendfile(output, input, 0/*ofset*/, fileinfo.st_size, 0/*hdtr*/, &bytesCopied, 0/*flags*/); + #else + //sendfile will work with non-socket output (i.e. regular file) on Linux 2.6.33+ + off_t bytesCopied = 0; |