diff mbox series

[alsa-utils,1/2] alsactl: Fix double decrease of lock timeout

Message ID 20201211225056.12301-1-tiwai@suse.de
State New
Headers show
Series [alsa-utils,1/2] alsactl: Fix double decrease of lock timeout | expand

Commit Message

Takashi Iwai Dec. 11, 2020, 10:50 p.m. UTC
The state_lock() has a loop to wait for the lock file creation, and
the timeout value gets decremented twice mistakenly, which leads to a
half timeout (5 seconds) than expected 10 seconds.  Fix it.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 alsactl/lock.c | 1 -
 1 file changed, 1 deletion(-)
diff mbox series

Patch

diff --git a/alsactl/lock.c b/alsactl/lock.c
index 4a485392b3bd..05f6e4d2a102 100644
--- a/alsactl/lock.c
+++ b/alsactl/lock.c
@@ -63,7 +63,6 @@  static int state_lock_(const char *file, int lock, int timeout, int _fd)
 			if (fd < 0) {
 				if (errno == EBUSY || errno == EAGAIN) {
 					sleep(1);
-					timeout--;
 				} else {
 					err = -errno;
 					goto out;