alsa-lib:pcm: returning semop error code for semaphore up/down failures.
PATCH 1/4 alsa-lib:pcm: returning semop error code for semaphore up/down failures.
From: Mounesh Sutar <[email protected]>
Signed-off-by Mounesh Sutar <[email protected]>
src/pcm/pcm_direct.h +8 -2
@@ -263,7 +263,10 @@ static inline int snd_pcm_direct_semaphore_down(snd_pcm_direct_t *dmix, int sem_ {struct sembuf op[2 ] = { { sem_num,0 ,0 }, { sem_num,1 ,SEM_UNDO } };int err =semop (dmix->semid, op,2 ); -if (err ==0 ) dmix->locked[sem_num]++; +if (err ==0 ) + dmix->locked[sem_num]++; +else if (err ==-1 ) + err = -errno;return err; }
@@ -271,7 +274,10 @@ static inline int snd_pcm_direct_semaphore_up(snd_pcm_direct_t *dmix, int sem_nu {struct sembuf op = { sem_num,-1 ,SEM_UNDO |IPC_NOWAIT };int err =semop (dmix->semid, &op,1 ); -if (err ==0 ) dmix->locked[sem_num]--; +if (err ==0 ) + dmix->locked[sem_num]--; +else if (err ==-1 ) + err = -errno;return err; }
Signature · 1 line
2.7.4
Takashi Iwai
AppliedQuoted 4 lines · On Tue, 10 Jan 2017 07:33:17 +0100, [email protected] wrote:
From: Mounesh Sutar <[email protected]>
Signed-off-by Mounesh Sutar <[email protected]>
Applied all four patches now. Thanks!
Takashi