mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 14:27:37 +08:00
Merged in hardlulz/modem-3.0-nuttx/fix-sem-EINTR (pull request #603)
Added ECANCELED condition to DEBUGASSERT-s checking sem_wait result Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
committed by
Gregory Nutt
parent
9e8332e5c8
commit
a8c58607e9
@@ -204,7 +204,7 @@ int usrsock_bind(FAR struct socket *psock,
|
||||
|
||||
while ((ret = net_lockedwait(&state.recvsem)) < 0)
|
||||
{
|
||||
DEBUGASSERT(ret == -EINTR);
|
||||
DEBUGASSERT(ret == -EINTR || ret == -ECANCELED);
|
||||
}
|
||||
|
||||
ret = state.result;
|
||||
|
||||
@@ -175,7 +175,7 @@ int usrsock_close(FAR struct usrsock_conn_s *conn)
|
||||
|
||||
while ((ret = net_lockedwait(&state.recvsem)) < OK)
|
||||
{
|
||||
DEBUGASSERT(ret == -EINTR);
|
||||
DEBUGASSERT(ret == -EINTR || ret == -ECANCELED);
|
||||
}
|
||||
|
||||
ret = state.result;
|
||||
|
||||
@@ -95,7 +95,7 @@ static void _usrsock_semtake(FAR sem_t *sem)
|
||||
* the wait was awakened by a signal.
|
||||
*/
|
||||
|
||||
DEBUGASSERT(ret == -EINTR);
|
||||
DEBUGASSERT(ret == -EINTR || ret == -ECANCELED);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -229,7 +229,7 @@ int usrsock_connect(FAR struct socket *psock,
|
||||
ret = net_lockedwait(&state.recvsem);
|
||||
if (ret < 0)
|
||||
{
|
||||
DEBUGASSERT(ret == -EINTR);
|
||||
DEBUGASSERT(ret == -EINTR || ret == -ECANCELED);
|
||||
|
||||
/* Wait interrupted, exit early. */
|
||||
|
||||
|
||||
@@ -1215,7 +1215,7 @@ int usrsockdev_do_request(FAR struct usrsock_conn_s *conn,
|
||||
|
||||
while ((ret = net_lockedwait(&dev->req.sem)) < 0)
|
||||
{
|
||||
DEBUGASSERT(ret == -EINTR);
|
||||
DEBUGASSERT(ret == -EINTR || ret == -ECANCELED);
|
||||
}
|
||||
|
||||
if (usrsockdev_is_opened(dev))
|
||||
@@ -1234,7 +1234,7 @@ int usrsockdev_do_request(FAR struct usrsock_conn_s *conn,
|
||||
|
||||
while ((ret = net_lockedwait(&dev->req.acksem)) < 0)
|
||||
{
|
||||
DEBUGASSERT(ret == -EINTR);
|
||||
DEBUGASSERT(ret == -EINTR || ret == -ECANCELED);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -235,7 +235,7 @@ int usrsock_getsockname(FAR struct socket *psock,
|
||||
|
||||
while ((ret = net_lockedwait(&state.reqstate.recvsem)) < 0)
|
||||
{
|
||||
DEBUGASSERT(ret == -EINTR);
|
||||
DEBUGASSERT(ret == -EINTR || ret == -ECANCELED);
|
||||
}
|
||||
|
||||
ret = state.reqstate.result;
|
||||
|
||||
@@ -246,7 +246,7 @@ int usrsock_getsockopt(FAR struct usrsock_conn_s *conn, int level, int option,
|
||||
|
||||
while ((ret = net_lockedwait(&state.reqstate.recvsem)) < 0)
|
||||
{
|
||||
DEBUGASSERT(ret == -EINTR);
|
||||
DEBUGASSERT(ret == -EINTR || ret == -ECANCELED);
|
||||
}
|
||||
|
||||
ret = state.reqstate.result;
|
||||
|
||||
@@ -444,7 +444,7 @@ ssize_t usrsock_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len,
|
||||
|
||||
while ((ret = net_lockedwait(&state.reqstate.recvsem)) < 0)
|
||||
{
|
||||
DEBUGASSERT(ret == -EINTR);
|
||||
DEBUGASSERT(ret == -EINTR || ret == -ECANCELED);
|
||||
}
|
||||
|
||||
ret = state.reqstate.result;
|
||||
|
||||
@@ -400,7 +400,7 @@ ssize_t usrsock_sendto(FAR struct socket *psock, FAR const void *buf,
|
||||
|
||||
while ((ret = net_lockedwait(&state.recvsem)) < 0)
|
||||
{
|
||||
DEBUGASSERT(ret == -EINTR);
|
||||
DEBUGASSERT(ret == -EINTR || ret == -ECANCELED);
|
||||
}
|
||||
|
||||
ret = state.result;
|
||||
|
||||
@@ -212,7 +212,7 @@ int usrsock_setsockopt(FAR struct usrsock_conn_s *conn, int level, int option,
|
||||
|
||||
while ((ret = net_lockedwait(&state.recvsem)) < 0)
|
||||
{
|
||||
DEBUGASSERT(ret == -EINTR);
|
||||
DEBUGASSERT(ret == -EINTR || ret == -ECANCELED);
|
||||
}
|
||||
|
||||
ret = state.result;
|
||||
|
||||
@@ -233,7 +233,7 @@ int usrsock_socket(int domain, int type, int protocol, FAR struct socket *psock)
|
||||
|
||||
while ((ret = net_lockedwait(&state.recvsem)) < 0)
|
||||
{
|
||||
DEBUGASSERT(ret == -EINTR);
|
||||
DEBUGASSERT(ret == -EINTR || ret == -ECANCELED);
|
||||
}
|
||||
|
||||
if (state.result < 0)
|
||||
|
||||
Reference in New Issue
Block a user