blob: c2a393881a6a5eaa82c4f251b3e9e75ab109efda (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
--- src/daemon/socket.cpp.orig Mon Feb 21 00:34:58 2000
+++ src/daemon/socket.cpp Mon Feb 21 00:43:15 2000
@@ -12,6 +12,7 @@
#include <netdb.h>
#include <fcntl.h>
#include <unistd.h>
+#include <osreldate.h>
#ifndef MSG_DONTWAIT
#define MSG_DONTWAIT 0
@@ -244,7 +245,11 @@
if (_nFlags & ADDR_LOCAL)
{
// Setup the local structure
+#if __FreeBSD_version < 400013
+ int sizeofSockaddr = sizeof(struct sockaddr_in);
+#else
socklen_t sizeofSockaddr = sizeof(struct sockaddr_in);
+#endif
if (getsockname(m_nDescriptor, (struct sockaddr *)&m_sLocalAddr, &sizeofSockaddr) < 0)
{
// errno has been set
@@ -480,7 +485,11 @@
*---------------------------------------------------------------------------*/
void TCPSocket::RecvConnection(TCPSocket &newSocket)
{
+#if __FreeBSD_version < 400013
+ int sizeofSockaddr = sizeof(struct sockaddr_in);
+#else
socklen_t sizeofSockaddr = sizeof(struct sockaddr_in);
+#endif
newSocket.m_nDescriptor = accept(m_nDescriptor, (struct sockaddr *)&newSocket.m_sRemoteAddr, &sizeofSockaddr);
newSocket.OpenSocket();
newSocket.SetAddrsFromSocket(ADDR_LOCAL | ADDR_REMOTE);
|