From 279d53c494b82226f98485797ed9ba0ab91e8603 Mon Sep 17 00:00:00 2001 From: Patrick Li Date: Tue, 12 Mar 2002 22:27:30 +0000 Subject: Add patch to allow twoftpd compile again. There is no such socket level SOL_TCP and sys/types.h should be included first. PR: 35826 Submitted by: maintainer --- ftp/twoftpd/Makefile | 1 + ftp/twoftpd/files/patch-socket::cork.c | 26 ++++++++++++++++++++++++++ ftp/twoftpd/files/patch-socket::uncork.c | 29 +++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 ftp/twoftpd/files/patch-socket::cork.c create mode 100644 ftp/twoftpd/files/patch-socket::uncork.c (limited to 'ftp/twoftpd') diff --git a/ftp/twoftpd/Makefile b/ftp/twoftpd/Makefile index e1b302bea970..ad5808f9abb1 100644 --- a/ftp/twoftpd/Makefile +++ b/ftp/twoftpd/Makefile @@ -7,6 +7,7 @@ PORTNAME= twoftpd PORTVERSION= 1.14 +PORTREVISION= 1 CATEGORIES= ftp MASTER_SITES= http://untroubled.org/twoftpd/ diff --git a/ftp/twoftpd/files/patch-socket::cork.c b/ftp/twoftpd/files/patch-socket::cork.c new file mode 100644 index 000000000000..f79d2b7b031e --- /dev/null +++ b/ftp/twoftpd/files/patch-socket::cork.c @@ -0,0 +1,26 @@ +--- socket/cork.c.orig Wed Mar 13 02:00:20 2002 ++++ socket/cork.c Wed Mar 13 02:01:45 2002 +@@ -15,9 +15,9 @@ + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ ++#include + #include + #include +-#include + #include + #include "socket.h" + +@@ -25,10 +25,10 @@ + { + #if defined(TCP_CORK) + int flag = 1; +- return setsockopt(sock, SOL_TCP, TCP_CORK, &flag, sizeof flag) == 0; ++ return setsockopt(sock, SOL_SOCKET, TCP_CORK, &flag, sizeof flag) == 0; + #elif defined(TCP_NOPUSH) + int flag = 1; +- return setsockopt(sock, SOL_TCP, TCP_NOPUSH, &flag, sizeof flag) == 0; ++ return setsockopt(sock, SOL_SOCKET, TCP_NOPUSH, &flag, sizeof flag) == 0; + #else + return 1; + #endif diff --git a/ftp/twoftpd/files/patch-socket::uncork.c b/ftp/twoftpd/files/patch-socket::uncork.c new file mode 100644 index 000000000000..c905540d0ff6 --- /dev/null +++ b/ftp/twoftpd/files/patch-socket::uncork.c @@ -0,0 +1,29 @@ +--- socket/uncork.c.orig Wed Mar 13 02:02:05 2002 ++++ socket/uncork.c Wed Mar 13 02:02:35 2002 +@@ -15,9 +15,9 @@ + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ ++#include + #include + #include +-#include + #include + #include "socket.h" + +@@ -25,13 +25,13 @@ + { + #if defined(TCP_CORK) + int flag = 0; +- return setsockopt(sock, SOL_TCP, TCP_CORK, &flag, sizeof flag) == 0; ++ return setsockopt(sock, SOL_SOCKET, TCP_CORK, &flag, sizeof flag) == 0; + #elif defined(TCP_NOPUSH) + /* BSD's TCP_NOPUSH option only takes effect after a write/send. + * Hopefully this extra write will cause the TCP stack to send out + * any buffered writes. */ + int flag = 0; +- if (setsockopt(sock, SOL_TCP, TCP_NOPUSH, &flag, sizeof flag) != 0) return 0; ++ if (setsockopt(sock, SOL_SOCKET, TCP_NOPUSH, &flag, sizeof flag) != 0) return 0; + return write(sock, &flag, 0) == 0; + #else + return 1; -- cgit v1.2.3