]> git.alsa-project.org Git - alsa-utils.git/commitdiff
alsactl: Fix double decrease of lock timeout
authorTakashi Iwai <tiwai@suse.de>
Fri, 11 Dec 2020 22:41:59 +0000 (23:41 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 11 Dec 2020 22:43:34 +0000 (23:43 +0100)
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

index 4a485392b3bd2dadc0525e967b2e82945c2b6dd1..05f6e4d2a1023a4ab69ad0bed33b4a54322a79f7 100644 (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;