mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -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 i;
|
||||
|
||||
if (dmix->semid < 0)
|
||||
return -EINVAL;
|
||||
for (i = 0; i < DIRECT_IPC_SEMS; i++) {
|
||||
if (semctl(dmix->semid, i, IPC_RMID, NULL) < 0)
|
||||
return -errno;
|
||||
}
|
||||
if (semctl(dmix->semid, 0, IPC_RMID, NULL) < 0)
|
||||
return -errno;
|
||||
dmix->semid = -1;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue