Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Jan 2000 02:50:04 -0800 (PST)
From:      Alexander Langer <alex@big.endian.de>
To:        freebsd-ports@FreeBSD.org
Subject:   Re: ports/16444: fix games/maelstrom (bentofied)
Message-ID:  <200001301050.CAA71671@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/16444; it has been noted by GNATS.

From: Alexander Langer <alex@big.endian.de>
To: Ade Lovett <ade@lovett.com>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: ports/16444: fix games/maelstrom (bentofied)
Date: Sun, 30 Jan 2000 11:13:56 +0100

 Thus spake Ade Lovett (ade@lovett.com):
 
 > socklen_t is only present in 4.x.  Please be a little more thoughtful
 > of the patches you're supplying.
 
 Hmm. I'm sorry, but I didn't know that it is int * in -stable.
 In fact, I've read so much code with socklen_t, that I thought it is
 the standard :-P (Steven's books as a small example)
 
 Try this as patch-ad then please.
 
 
 --- netlogic/netplay.cpp.orig	Thu Dec 12 17:14:46 1996
 +++ netlogic/netplay.cpp	Sun Jan 30 11:08:49 2000
 @@ -24,6 +24,7 @@
  #include <netinet/in.h>
  #include <arpa/inet.h>
  #endif /* Win95 */
 +#include <osreldate.h>
  
  int   gNumPlayers;
  int   gOurPlayer;
 @@ -431,8 +432,13 @@
  		/* We are guaranteed that there is data here */
  readit:
  		clen = sizeof(from);
 +#if (__FreeBSD_version < 400000)
  		len = recvfrom(gNetFD, (char *)buf, BUFSIZ, 0, 
  					(struct sockaddr *)&from, &clen);
 +#else
 +		len = recvfrom(gNetFD, (char *)buf, BUFSIZ, 0, 
 +					(struct sockaddr *)&from, (socklen_t *) &clen);
 +#endif
  		if ( len <= 0 ) {
  			if ( errno == EINTR ) {
  				errno = 0;
 @@ -585,8 +591,13 @@
  
  		/* Suck up the packet */
  		clen = sizeof(from);
 +#if (__FreeBSD_version < 400000)
  		(void) recvfrom(gNetFD, netbuf, BUFSIZ, 0, 
  					(struct sockaddr *)&from, &clen);
 +#else
 +		(void) recvfrom(gNetFD, netbuf, BUFSIZ, 0, 
 +					(struct sockaddr *)&from, (socklen_t *) &clen);
 +#endif
  	}
  }
  	
 @@ -887,8 +898,13 @@
  
  		/* We are guaranteed that there is data here */
  		clen = sizeof(from);
 +#if (__FreeBSD_version < 400000)
  		len = recvfrom(gNetFD, (char *)netbuf, BUFSIZ, 0, 
  					(struct sockaddr *)&from, &clen);
 +#else
 +		len = recvfrom(gNetFD, (char *)netbuf, BUFSIZ, 0, 
 +					(struct sockaddr *)&from, (socklen_t *) &clen);
 +#endif
  		if ( len <= 0 ) {
  			perror("Network error in Send_NewGame(): recvfrom()");
  			return(-1);
 @@ -991,8 +1007,13 @@
  
  		/* We are guaranteed that there is data here */
  		clen = sizeof(from);
 +#if (__FreeBSD_version < 400000)
  		len = recvfrom(gNetFD, (char *)netbuf, BUFSIZ, 0, 
  					(struct sockaddr *)&from, &clen);
 +#else
 +		len = recvfrom(gNetFD, (char *)netbuf, BUFSIZ, 0, 
 +					(struct sockaddr *)&from, (socklen_t *) &clen);
 +#endif
  		if ( len < 0 ) {
  			perror("Network error in Await_NewGame(): recvfrom()");
  			return(-1);
 
 Alex
 
 -- 
 I doubt, therefore I might be. 
 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




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