mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 14:27:37 +08:00
Networking: Missed removal of one net_unlock() in previous commit.
This commit is contained in:
+8
-11
@@ -757,7 +757,7 @@ static int inet_accept(FAR struct socket *psock, FAR struct sockaddr *addr,
|
|||||||
|
|
||||||
if (psock->s_type != SOCK_STREAM)
|
if (psock->s_type != SOCK_STREAM)
|
||||||
{
|
{
|
||||||
nerr("ERROR: Inappropreat socket type: %d\n", psock->s_type);
|
nerr("ERROR: Inappropriate socket type: %d\n", psock->s_type);
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -813,13 +813,15 @@ static int inet_accept(FAR struct socket *psock, FAR struct sockaddr *addr,
|
|||||||
|
|
||||||
#ifdef CONFIG_NET_TCP
|
#ifdef CONFIG_NET_TCP
|
||||||
#ifdef NET_TCP_HAVE_STACK
|
#ifdef NET_TCP_HAVE_STACK
|
||||||
/* Perform the local accept operation (the network locked must be locked) */
|
/* Perform the local accept operation (the network locked must be locked
|
||||||
|
* by the caller).
|
||||||
|
*/
|
||||||
|
|
||||||
ret = psock_tcp_accept(psock, addr, addrlen, &newsock->s_conn);
|
ret = psock_tcp_accept(psock, addr, addrlen, &newsock->s_conn);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
nerr("ERROR: psock_tcp_accept failed: %d\n", ret);
|
nerr("ERROR: psock_tcp_accept failed: %d\n", ret);
|
||||||
goto errout_with_lock;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Begin monitoring for TCP connection events on the newly connected
|
/* Begin monitoring for TCP connection events on the newly connected
|
||||||
@@ -834,22 +836,17 @@ static int inet_accept(FAR struct socket *psock, FAR struct sockaddr *addr,
|
|||||||
* everything we have done and return a failure.
|
* everything we have done and return a failure.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
goto errout_after_accept;
|
psock_close(newsock);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
|
|
||||||
errout_after_accept:
|
|
||||||
psock_close(newsock);
|
|
||||||
|
|
||||||
errout_with_lock:
|
|
||||||
net_unlock();
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
nwarn("WARNING: SOCK_STREAM not supported in this configuration\n");
|
nwarn("WARNING: SOCK_STREAM not supported in this configuration\n");
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
#endif /* NET_TCP_HAVE_STACK */
|
#endif /* NET_TCP_HAVE_STACK */
|
||||||
|
|
||||||
#else
|
#else
|
||||||
nwarn("WARNING: TCP/IP not supported in this configuration\n");
|
nwarn("WARNING: TCP/IP not supported in this configuration\n");
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
|
|||||||
Reference in New Issue
Block a user