KAME/NetBSD142 compatibility patch from Itojun <itojun@iijlab.net> applied

This commit is contained in:
Pontus Lidman 2000-04-18 20:49:26 +00:00
parent 7c5c21c5a7
commit 8cef444f8d
2 changed files with 10 additions and 5 deletions

View file

@ -427,6 +427,7 @@ int UDP_OpenSocket (int port)
if ((newsocket = socket(res->ai_family, res->ai_socktype, res->ai_protocol)) == -1)
Sys_Error ("UDP_OpenSocket: socket:", strerror(errno));
// FIONBIO sets non-blocking IO for this socket
if (ioctl (newsocket, FIONBIO, (char *)&_true) == -1)
Sys_Error ("UDP_OpenSocket: ioctl FIONBIO:", strerror(errno));

View file

@ -33,15 +33,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <stdio.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
/* Sun's model_t in sys/model.h conflicts w/ Quake's model_t */
#define model_t quakeforgemodel_t
#ifndef INADDR_LOOPBACK
#define INADDR_LOOPBACK (u_int32_t)0x7f000001
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
@ -66,6 +64,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# include <sys/filio.h>
#endif
#ifndef INADDR_LOOPBACK
#define INADDR_LOOPBACK (u_int32_t)0x7f000001
#endif
#undef model_t
#ifdef NeXT
@ -285,7 +287,9 @@ int UDP_OpenSocket (int port)
int newsocket;
// struct sockaddr_in address;
int _true = 1;
//const int false = 0;
#ifdef IPV6_BINDV6ONLY
const int false = 0;
#endif
// if ((newsocket = socket (PF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1)
// return -1;