diff --git a/alsactl/lock.c b/alsactl/lock.c index 05f6e4d..5b47462 100644 --- a/alsactl/lock.c +++ b/alsactl/lock.c @@ -63,10 +63,15 @@ static int state_lock_(const char *file, int lock, int timeout, int _fd) if (fd < 0) { if (errno == EBUSY || errno == EAGAIN) { sleep(1); - } else { - err = -errno; - goto out; + continue; } + if (errno == EEXIST) { + fd = open(nfile, O_RDWR); + if (fd >= 0) + break; + } + err = -errno; + goto out; } } }