mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 21:36:28 +08:00
net/soerr: add new _SO_CONN_SETERRNO() macro
support so error code set from conn instance Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
@@ -165,10 +165,7 @@ static uint16_t tcp_monitor_event(FAR struct net_driver_s *dev,
|
||||
|
||||
/* Clear the socket error */
|
||||
|
||||
#ifdef CONFIG_NET_SOCKOPTS
|
||||
conn->sconn.s_error = OK;
|
||||
#endif
|
||||
set_errno(OK);
|
||||
_SO_CONN_SETERRNO(conn, OK);
|
||||
|
||||
/* Indicate that the socket is now connected */
|
||||
|
||||
|
||||
@@ -128,10 +128,7 @@ static uint16_t tcp_poll_eventhandler(FAR struct net_driver_s *dev,
|
||||
reason = ECONNREFUSED;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_NET_SOCKOPTS
|
||||
info->conn->sconn.s_error = reason;
|
||||
#endif
|
||||
set_errno(reason);
|
||||
_SO_CONN_SETERRNO(info->conn, reason);
|
||||
|
||||
/* Mark that the connection has been lost */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user