MT#55283 convert listen to bool

Change-Id: I18ab74fcd1e5ca330619a357d6ee080be45b2ab5
pull/1910/head
Richard Fuchs 10 months ago
parent 88bbfc2255
commit 55ccc6bbe1

@ -80,7 +80,7 @@ static int tcp_listener_init(socket_t *sock, const endpoint_t *ep,
if (!open_socket(sock, SOCK_STREAM, ep->port, &ep->address))
goto fail;
if (sock->family->listen(sock, 5))
if (!sock->family->listen(sock, 5))
goto fail;
ZERO(i);

@ -25,7 +25,7 @@ static bool __ip4_is_specified(const sockaddr_t *a);
static bool __ip6_is_specified(const sockaddr_t *a);
static bool __ip_bind(socket_t *s, unsigned int, const sockaddr_t *);
static bool __ip_connect(socket_t *s, const endpoint_t *);
static int __ip_listen(socket_t *s, int backlog);
static bool __ip_listen(socket_t *s, int backlog);
static int __ip_accept(socket_t *s, socket_t *new_sock);
static int __ip_timestamping(socket_t *s);
static int __ip4_pktinfo(socket_t *s);
@ -289,8 +289,8 @@ static bool __ip_connect(socket_t *s, const endpoint_t *ep) {
}
return true;
}
static int __ip_listen(socket_t *s, int backlog) {
return listen(s->fd, backlog);
static bool __ip_listen(socket_t *s, int backlog) {
return listen(s->fd, backlog) == 0;
}
static int __ip_accept(socket_t *s, socket_t *newsock) {
int nfd;

@ -71,7 +71,7 @@ struct socket_family {
bool (*addrport2sockaddr)(void *, const sockaddr_t *, unsigned int);
bool (*bind)(socket_t *, unsigned int, const sockaddr_t *);
bool (*connect)(socket_t *, const endpoint_t *);
int (*listen)(socket_t *, int);
bool (*listen)(socket_t *, int);
int (*accept)(socket_t *, socket_t *);
int (*timestamping)(socket_t *);
int (*pktinfo)(socket_t *);

Loading…
Cancel
Save