static int cmpforsearch(void *av, void *bv)
{
Actual_Socket b = (Actual_Socket) bv;
- int as = (int) av, bs = b->s;
+ int as = *(int *)av, bs = b->s;
if (as < bs)
return -1;
if (as > bs)
sk_tcp_socket_error
};
-Socket sk_register(void *sock, Plug plug)
+Socket sk_register(OSSocket sockfd, Plug plug)
{
Actual_Socket ret;
ret->oobpending = FALSE;
ret->listener = 0;
- ret->s = (int)sock;
+ ret->s = sockfd;
if (ret->s < 0) {
ret->error = error_string(errno);
uxsel_tell(ret);
add234(sktree, ret);
+ sk_addr_free(addr);
+
return (Socket) ret;
}
u_long atmark;
/* Find the Socket structure */
- s = find234(sktree, (void *) fd, cmpforsearch);
+ s = find234(sktree, &fd, cmpforsearch);
if (!s)
return 1; /* boggle */
if (s->localhost_only && !ipv4_is_loopback(isa.sin_addr)) {
close(t); /* someone let nonlocal through?! */
- } else if (plug_accepting(s->plug, (void*)t)) {
+ } else if (plug_accepting(s->plug, t)) {
close(t); /* denied or error */
}
break;