aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarino <marino@FreeBSD.org>2015-03-26 22:18:50 +0800
committermarino <marino@FreeBSD.org>2015-03-26 22:18:50 +0800
commit0b2b8750ef497b37aaefdf7d9b9e8abd4eaf2b0e (patch)
treefc25fe2edfb976293f1e8ea0018f2d5b93cef409
parentdba7ad15fbc3917514f2c05344e11e660d348ed2 (diff)
downloadfreebsd-ports-gnome-0b2b8750ef497b37aaefdf7d9b9e8abd4eaf2b0e.tar.gz
freebsd-ports-gnome-0b2b8750ef497b37aaefdf7d9b9e8abd4eaf2b0e.tar.zst
freebsd-ports-gnome-0b2b8750ef497b37aaefdf7d9b9e8abd4eaf2b0e.zip
ftp/pftpd: Add DragonFly support
Bring in fix from dports (port is not maintained)
-rw-r--r--ftp/pftpd/files/patch-plib_dirlist.c23
-rw-r--r--ftp/pftpd/files/patch-plib_safeio.c11
2 files changed, 30 insertions, 4 deletions
diff --git a/ftp/pftpd/files/patch-plib_dirlist.c b/ftp/pftpd/files/patch-plib_dirlist.c
index f770c9c1930a..fb8f2cb185ea 100644
--- a/ftp/pftpd/files/patch-plib_dirlist.c
+++ b/ftp/pftpd/files/patch-plib_dirlist.c
@@ -1,12 +1,27 @@
---- plib/dirlist.c.orig Tue Feb 1 10:43:35 2005
-+++ plib/dirlist.c Mon May 23 18:35:47 2005
-@@ -80,7 +80,9 @@
- len = strlen(name);
+--- plib/dirlist.c.orig 2013-07-04 11:10:49 UTC
++++ plib/dirlist.c
+@@ -66,7 +66,11 @@ dirent_dup(const struct dirent *dep)
+ n_dep = a_malloc(len, "struct dirent");
+ memcpy(n_dep, dep, len);
+ #else
++# ifdef __DragonFly__
++ n_dep = a_malloc(len = _DIRENT_RECLEN(dep->d_namlen), "struct dirent");
++# else
+ n_dep = a_malloc(len = dep->d_reclen, "struct dirent");
++# endif
+ #endif
+ memcpy(n_dep, dep, len);
+
+@@ -91,8 +95,12 @@ dirent_alloc(ino_t ino, const char *name
+
dp = a_malloc(sizeof(*dp)+len, "struct dirent");
dp->d_ino = ino;
+#ifdef linux
dp->d_off = 0;
+#endif /* linux */
++#ifndef __DragonFly__
dp->d_reclen = len;
++#endif
strcpy(dp->d_name, name);
+ return dp;
diff --git a/ftp/pftpd/files/patch-plib_safeio.c b/ftp/pftpd/files/patch-plib_safeio.c
new file mode 100644
index 000000000000..741d7affd7d6
--- /dev/null
+++ b/ftp/pftpd/files/patch-plib_safeio.c
@@ -0,0 +1,11 @@
+--- plib/safeio.c.orig 2013-07-04 11:10:49 UTC
++++ plib/safeio.c
+@@ -448,7 +448,7 @@
+ {
+ int err;
+
+-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
++#if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(__DragonFly__)
+ off_t sbytes;
+ while ((err = sendfile(to_fd, from_fd, *start, len,
+ NULL, &sbytes, 0)) == -1) {