This change implements the SO_ERROR socket option that is used to obtain the last error reported by the network.

Squashed commit of the following:

Author: Gregory Nutt <gnutt@nuttx.org>

    net/: Trivial changes to PR from review.  Biggest difference:  type of s_error changed to int16_t to save a byte or two.

Author: liuhuahang <liuhuahang@xiaomi.com>

    Implement SO_ERROR for getsockopt()
This commit is contained in:
liuhuahang
2019-12-24 08:09:55 -06:00
committed by Gregory Nutt
parent 10c4aff6ca
commit ce634578dd
13 changed files with 60 additions and 21 deletions
+1 -1
View File
@@ -159,7 +159,7 @@ int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen)
ret = psock_bind(psock, addr, addrlen);
if (ret < 0)
{
set_errno(-ret);
_SO_SETERRNO(psock, -ret);
return ERROR;
}