more BSD compat
This commit is contained in:
parent
08b68f1bdc
commit
824630a489
@ -2,9 +2,9 @@
|
|||||||
#include "io_internal.h"
|
#include "io_internal.h"
|
||||||
|
|
||||||
void io_close(int64 d) {
|
void io_close(int64 d) {
|
||||||
|
io_entry* e;
|
||||||
close(d);
|
close(d);
|
||||||
io_entry* e=array_get(&io_fds,sizeof(io_entry),d);
|
if ((e=array_get(&io_fds,sizeof(io_entry),d))) {
|
||||||
if (e) {
|
|
||||||
e->inuse=0;
|
e->inuse=0;
|
||||||
io_dontwantread(d);
|
io_dontwantread(d);
|
||||||
io_dontwantwrite(d);
|
io_dontwantwrite(d);
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/select.h>
|
#include <sys/select.h>
|
||||||
|
|
||||||
|
/* braindead BSD uses bzero in FD_ZERO but doesn't #include string.h */
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
extern int select();
|
extern int select();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -12,13 +12,13 @@ int socket_bind6(int s,const char ip[16],uint16 port,uint32 scope_id)
|
|||||||
#ifdef LIBC_HAS_IP6
|
#ifdef LIBC_HAS_IP6
|
||||||
struct sockaddr_in6 sa;
|
struct sockaddr_in6 sa;
|
||||||
#endif
|
#endif
|
||||||
|
int i;
|
||||||
|
|
||||||
if (!ip) ip=V6any;
|
if (!ip) ip=V6any;
|
||||||
|
|
||||||
#ifdef LIBC_HAS_IP6
|
#ifdef LIBC_HAS_IP6
|
||||||
if (noipv6) {
|
if (noipv6) {
|
||||||
#endif
|
#endif
|
||||||
int i;
|
|
||||||
for (i=0; i<16; i++)
|
for (i=0; i<16; i++)
|
||||||
if (ip[i]!=0) break;
|
if (ip[i]!=0) break;
|
||||||
if (i==16 || ip6_isv4mapped(ip))
|
if (i==16 || ip6_isv4mapped(ip))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user