mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
net_startmonitor.c always returned zero. In the case where a socket has already been closed, it correctly handled the disconnetion event but still returned OK. Returning OK causes the callers of net_startmonitor to assume that the connection was okay, undoing the good things that net_startmonitor did and causing the socket to be marked as connected. This behavior was noted by Pelle Windestam.
This commit is contained in:
+7
-1
@@ -231,7 +231,13 @@ FAR struct socket *sockfd_socket(int sockfd);
|
||||
* psock - The socket of interest
|
||||
*
|
||||
* Returned Value:
|
||||
* For now, this function always returns OK.
|
||||
* On success, net_startmonitor returns OK; On any failure,
|
||||
* net_startmonitor will return a negated errno value. The only failure
|
||||
* that can occur is if the socket has already been closed and, in this
|
||||
* case, -ENOTCONN is returned.
|
||||
*
|
||||
* Assumptions:
|
||||
* The caller holds the network lock.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user