mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 14:53:47 +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
@@ -444,7 +444,7 @@ static ssize_t mac802154dev_read(FAR struct file *filep, FAR char *buffer,
|
||||
ret = nxsem_wait(&dev->readsem);
|
||||
if (ret < 0)
|
||||
{
|
||||
DEBUGASSERT(ret == -EINTR);
|
||||
DEBUGASSERT(ret == -EINTR || ret == -ECANCELED);
|
||||
dev->readpending = false;
|
||||
return ret;
|
||||
}
|
||||
@@ -681,7 +681,7 @@ static int mac802154dev_ioctl(FAR struct file *filep, int cmd,
|
||||
ret = nxsem_wait(&dev->geteventsem);
|
||||
if (ret < 0)
|
||||
{
|
||||
DEBUGASSERT(ret == -EINTR);
|
||||
DEBUGASSERT(ret == -EINTR || ret == -ECANCELED);
|
||||
dev->geteventpending = false;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -533,9 +533,9 @@ static inline int mac802154_takesem(sem_t *sem, bool allowinterrupt)
|
||||
ret = nxsem_wait(sem);
|
||||
if (ret < 0)
|
||||
{
|
||||
/* EINTR is the only error that we expect */
|
||||
/* EINTR and ECANCELED are the only errors that we expect */
|
||||
|
||||
DEBUGASSERT(ret == -EINTR);
|
||||
DEBUGASSERT(ret == -EINTR || ret == -ECANCELED);
|
||||
|
||||
if (allowinterrupt)
|
||||
{
|
||||
|
||||
@@ -1114,7 +1114,7 @@ static int macnet_ioctl(FAR struct net_driver_s *dev, int cmd,
|
||||
ret = nxsem_wait(&priv->md_eventsem);
|
||||
if (ret < 0)
|
||||
{
|
||||
DEBUGASSERT(ret == -EINTR);
|
||||
DEBUGASSERT(ret == -EINTR || ret == -ECANCELED);
|
||||
priv->md_eventpending = false;
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user