alsactl: Fix double decrease of lock timeout

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>
This commit is contained in:
Takashi Iwai 2020-12-11 23:41:59 +01:00
parent 0385e8ebd4
commit 878e1a7c0f

View file

@ -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;