mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
Avoid unnecesasry call of resmgr
Avoid unnecesasry call of resmgr if the device file really doesn't exist.
This commit is contained in:
parent
37aa30ddc3
commit
609d4a7de6
1 changed files with 3 additions and 1 deletions
|
|
@ -238,7 +238,9 @@ static inline int snd_open_device(const char *filename, int fmode)
|
||||||
return fd;
|
return fd;
|
||||||
if (errno == EAGAIN || errno == EBUSY)
|
if (errno == EAGAIN || errno == EBUSY)
|
||||||
return fd;
|
return fd;
|
||||||
return rsm_open_device(filename, fmode);
|
if (! access(filename, F_OK))
|
||||||
|
return rsm_open_device(filename, fmode);
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#define snd_open_device(filename, fmode) open(filename, fmode);
|
#define snd_open_device(filename, fmode) open(filename, fmode);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue