mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-01 22:58:49 -04:00
Fix call of semctl IPC_RMID
semctl IPC_RMID removes all semaphore set, so we need to call this only once.
This commit is contained in:
parent
745062ee01
commit
6f938b1cc3
1 changed files with 2 additions and 6 deletions
|
|
@ -73,14 +73,10 @@ int snd_pcm_direct_semaphore_create_or_connect(snd_pcm_direct_t *dmix)
|
||||||
|
|
||||||
int snd_pcm_direct_semaphore_discard(snd_pcm_direct_t *dmix)
|
int snd_pcm_direct_semaphore_discard(snd_pcm_direct_t *dmix)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
|
|
||||||
if (dmix->semid < 0)
|
if (dmix->semid < 0)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
for (i = 0; i < DIRECT_IPC_SEMS; i++) {
|
if (semctl(dmix->semid, 0, IPC_RMID, NULL) < 0)
|
||||||
if (semctl(dmix->semid, i, IPC_RMID, NULL) < 0)
|
|
||||||
return -errno;
|
return -errno;
|
||||||
}
|
|
||||||
dmix->semid = -1;
|
dmix->semid = -1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue