anchao commented on code in PR #7675: URL: https://github.com/apache/incubator-nuttx/pull/7675#discussion_r1031418784
########## net/socket/socket.h: ########## @@ -94,18 +94,30 @@ /* Macro to set socket errors */ #ifdef CONFIG_NET_SOCKOPTS +# define _SO_CONN_SETERRNO(c,e) \ + do \ + { \ + (c)->s_error = (int16_t)e; \ + set_errno(e); \ + } \ + while (0) + # define _SO_SETERRNO(s,e) \ do \ { \ if (s != NULL && (s)->s_conn != NULL) \ Review Comment: Done ########## net/socket/socket.h: ########## @@ -94,18 +94,30 @@ /* Macro to set socket errors */ #ifdef CONFIG_NET_SOCKOPTS +# define _SO_CONN_SETERRNO(c,e) \ + do \ + { \ + (c)->s_error = (int16_t)e; \ + set_errno(e); \ + } \ + while (0) + # define _SO_SETERRNO(s,e) \ do \ { \ if (s != NULL && (s)->s_conn != NULL) \ { \ FAR struct socket_conn_s *_conn = (s)->s_conn; \ - _conn->s_error = (int16_t)e; \ + _SO_CONN_SETERRNO(_conn, e); \ Review Comment: Done -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org