fixed bug #41729 Some socket functions return Exyz instead of -1

This commit is contained in:
Simon Goldschmidt 2014-02-27 20:57:37 +01:00
parent 8558fa0bcf
commit 2666d6df90
2 changed files with 8 additions and 5 deletions

View File

@ -96,8 +96,11 @@ HISTORY
++ Bugfixes:
2014-02-27: Simon Goldschmidt
* sockets.c: fixed bug #41729 Some socket functions return Exyz instead of -1
2014-02-25: Simon Goldschmidt
ip4.c: fixed bug #39514 ip_route() may return an IPv6-only interface
* ip4.c: fixed bug #39514 ip_route() may return an IPv6-only interface
2014-02-25: Simon Goldschmidt, patch by Fatih Asici
* pbuf.c: fixed bug #39356 Wrong increment in pbuf_memfind()

View File

@ -612,7 +612,7 @@ lwip_listen(int s, int backlog)
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_listen(%d) failed, err=%d\n", s, err));
if (NETCONNTYPE_GROUP(netconn_type(sock->conn)) != NETCONN_TCP) {
sock_set_errno(sock, EOPNOTSUPP);
return EOPNOTSUPP;
return -1;
}
sock_set_errno(sock, err_to_errno(err));
return -1;
@ -1447,11 +1447,11 @@ lwip_shutdown(int s, int how)
if (sock->conn != NULL) {
if (NETCONNTYPE_GROUP(netconn_type(sock->conn)) != NETCONN_TCP) {
sock_set_errno(sock, EOPNOTSUPP);
return EOPNOTSUPP;
return -1;
}
} else {
sock_set_errno(sock, ENOTCONN);
return ENOTCONN;
return -1;
}
if (how == SHUT_RD) {
@ -1463,7 +1463,7 @@ lwip_shutdown(int s, int how)
shut_tx = 1;
} else {
sock_set_errno(sock, EINVAL);
return EINVAL;
return -1;
}
err = netconn_shutdown(sock->conn, shut_rx, shut_tx);