Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-kde
Path: blob/main/deskutils/cairo-dock/files/patch-src_gldit_cairo-dock-file-manager.c
16461 views
1
--- src/gldit/cairo-dock-file-manager.c.orig 2014-10-15 14:16:34 UTC
2
+++ src/gldit/cairo-dock-file-manager.c
3
@@ -21,7 +21,11 @@
4
#include <string.h> // memset
5
#include <sys/stat.h> // stat
6
#include <fcntl.h> // open
7
+#if defined (__FreeBSD__) || defined (__DragonFly__)
8
+#include <sys/socket.h>
9
+#else
10
#include <sys/sendfile.h> // sendfile
11
+#endif
12
#include <errno.h> // errno
13
14
#include "gldi-config.h"
15
@@ -500,7 +504,7 @@ gboolean cairo_dock_copy_file (const gch
16
{
17
// perform in-kernel transfer (zero copy to user space)
18
int size;
19
- #ifdef __FreeBSD__
20
+ #if defined (__FreeBSD__) || defined (__DragonFly__)
21
size = sendfile (src_fd, dest_fd, 0, stat.st_size, NULL, NULL, 0);
22
#else // Linux >= 2.6.33 for being able to have a regular file as the output socket
23
size = sendfile (dest_fd, src_fd, NULL, stat.st_size); // note the inversion between both calls ^_^;
24
25