pkgsrc/games/abuse/patches/patch-ai
joerg 260021a549 Add DragonFly to the systems with socklen_t. Remove an useless
make_block call which depends on the size of FILE.
2005-11-11 15:20:41 +00:00

35 lines
948 B
Text

$NetBSD: patch-ai,v 1.2 2005/11/11 15:20:41 joerg Exp $
--- abuse/src/net/mac/tcpip.hpp 2002/07/16 13:57:41 1.1
+++ abuse/src/net/mac/tcpip.hpp 2002/07/16 13:59:05
@@ -146,6 +146,12 @@
void broadcastable();
} ;
+#if defined(__NetBSD__) || defined(__DragonFly__)
+#define SOCKLEN_TYPE __socklen_t
+#else
+#define SOCKLEN_TYPE int
+#endif
+
class tcp_socket : public unix_fd
{
int listening;
@@ -176,7 +182,7 @@
if (listening)
{
struct sockaddr_in from;
- int addr_len=sizeof(from);
+ SOCKLEN_TYPE addr_len=sizeof(from);
int new_fd=::accept(fd,(sockaddr *)&from,&addr_len);
if (new_fd>=0)
{
@@ -200,7 +206,7 @@
if (addr)
{
*addr=new ip_address;
- int addr_size=sizeof(sockaddr_in);
+ SOCKLEN_TYPE addr_size=sizeof(sockaddr_in);
tr=recvfrom(fd,buf,size,0, (sockaddr *) &((ip_address *)(*addr))->addr,&addr_size);
} else
tr=recv(fd,buf,size,0);