Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Mar 2010 16:54:57 +0000 (UTC)
From:      Luigi Rizzo <luigi@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r204716 - head/sbin/ipfw
Message-ID:  <201003041654.o24GsvCv032208@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: luigi
Date: Thu Mar  4 16:54:56 2010
New Revision: 204716
URL: http://svn.freebsd.org/changeset/base/204716

Log:
  reduce diffs with the cross-platform version (windows needs
  some extra initialization)

Modified:
  head/sbin/ipfw/main.c

Modified: head/sbin/ipfw/main.c
==============================================================================
--- head/sbin/ipfw/main.c	Thu Mar  4 16:54:16 2010	(r204715)
+++ head/sbin/ipfw/main.c	Thu Mar  4 16:54:56 2010	(r204716)
@@ -583,6 +583,20 @@ ipfw_readfile(int ac, char *av[])
 int
 main(int ac, char *av[])
 {
+#if defined(_WIN32) && defined(TCC)
+	{
+		WSADATA wsaData;
+		int ret=0;
+		unsigned short wVersionRequested = MAKEWORD(2, 2);
+		ret = WSAStartup(wVersionRequested, &wsaData);
+		if (ret != 0) {
+			/* Tell the user that we could not find a usable */
+			/* Winsock DLL.                                  */
+			printf("WSAStartup failed with error: %d\n", ret);
+			return 1;
+		}
+	}
+#endif
 	/*
 	 * If the last argument is an absolute pathname, interpret it
 	 * as a file to be preprocessed.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201003041654.o24GsvCv032208>