anchao commented on code in PR #7675:
URL: https://github.com/apache/incubator-nuttx/pull/7675#discussion_r1031418976


##########
net/rpmsg/rpmsg_sockif.c:
##########
@@ -287,11 +286,9 @@ static int rpmsg_socket_ept_cb(FAR struct rpmsg_endpoint 
*ept,
       nxmutex_lock(&conn->recvlock);
       conn->sendsize = head->size;
 
-      if (conn->psock)
-        {
-          conn->sconn.s_flags |= _SF_CONNECTED;
-          _SO_SETERRNO(conn->psock, OK);
-        }
+      conn->sconn.s_flags |= _SF_CONNECTED;
+
+      _SO_CONN_SETERRNO(&conn->sconn, OK);

Review Comment:
   Done



##########
net/tcp/tcp_netpoll.c:
##########
@@ -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->sconn, reason);

Review Comment:
   Done



##########
net/tcp/tcp_monitor.c:
##########
@@ -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->sconn, OK);

Review Comment:
   Done



##########
net/socket/net_sendfile.c:
##########
@@ -133,8 +133,7 @@ ssize_t psock_sendfile(FAR struct socket *psock, FAR struct 
file *infile,
 
   if (ret < 0)
     {
-      FAR struct socket_conn_s *conn = psock->s_conn;
-      conn->s_error = -ret;
+      _SO_CONN_SETERRNO((FAR struct socket_conn_s *)psock->s_conn, -ret);

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

Reply via email to