diff --git a/io/io_close.c b/io/io_close.c index 190a55c..b155b24 100644 --- a/io/io_close.c +++ b/io/io_close.c @@ -2,9 +2,9 @@ #include "io_internal.h" void io_close(int64 d) { + io_entry* e; close(d); - io_entry* e=array_get(&io_fds,sizeof(io_entry),d); - if (e) { + if ((e=array_get(&io_fds,sizeof(io_entry),d))) { e->inuse=0; io_dontwantread(d); io_dontwantwrite(d); diff --git a/select.h2 b/select.h2 index 2bc2044..961c380 100644 --- a/select.h2 +++ b/select.h2 @@ -6,6 +6,10 @@ #include #include #include + +/* braindead BSD uses bzero in FD_ZERO but doesn't #include string.h */ +#include + extern int select(); #endif diff --git a/socket/socket_bind6.c b/socket/socket_bind6.c index 4cadfac..551cfe3 100644 --- a/socket/socket_bind6.c +++ b/socket/socket_bind6.c @@ -12,13 +12,13 @@ int socket_bind6(int s,const char ip[16],uint16 port,uint32 scope_id) #ifdef LIBC_HAS_IP6 struct sockaddr_in6 sa; #endif + int i; if (!ip) ip=V6any; #ifdef LIBC_HAS_IP6 if (noipv6) { #endif - int i; for (i=0; i<16; i++) if (ip[i]!=0) break; if (i==16 || ip6_isv4mapped(ip))