mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 07:12:54 +08:00
Squashed commit of the following:
sched/semaphore: Add nxsem_post() which is identical to sem_post() except that it never modifies the errno variable. Changed all references to sem_post in the OS to nxsem_post().
sched/semaphore: Add nxsem_destroy() which is identical to sem_destroy() except that it never modifies the errno variable. Changed all references to sem_destroy() in the OS to nxsem_destroy().
libc/semaphore and sched/semaphore: Add nxsem_getprotocol() and nxsem_setprotocola which are identical to sem_getprotocol() and set_setprotocol() except that they never modifies the errno variable. Changed all references to sem_setprotocol in the OS to nxsem_setprotocol(). sem_getprotocol() was not used in the OS
This commit is contained in:
@@ -191,7 +191,7 @@ static ssize_t xen1210_read(FAR struct file *filep, FAR char *buffer,
|
||||
|
||||
buffer = (FAR char *) &priv->sample;
|
||||
|
||||
sem_post(&priv->exclsem);
|
||||
nxsem_post(&priv->exclsem);
|
||||
return sizeof(struct xen1210_sample_s);
|
||||
}
|
||||
|
||||
@@ -389,14 +389,14 @@ int xen1210_register(XEN1210_HANDLE handle, int minor)
|
||||
if (ret < 0)
|
||||
{
|
||||
snerr("ERROR: Failed to register driver %s: %d\n", devname, ret);
|
||||
sem_post(&priv->exclsem);
|
||||
nxsem_post(&priv->exclsem);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Indicate that the accelerometer was successfully initialized */
|
||||
|
||||
priv->status |= XEN1210_STAT_INITIALIZED; /* Accelerometer is initialized */
|
||||
sem_post(&priv->exclsem);
|
||||
nxsem_post(&priv->exclsem);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user