Avoid unnecesasry call of resmgr

Avoid unnecesasry call of resmgr if the device file really doesn't exist.
This commit is contained in:
Takashi Iwai 2006-02-20 19:32:53 +00:00
parent 37aa30ddc3
commit 609d4a7de6

View file

@ -238,7 +238,9 @@ static inline int snd_open_device(const char *filename, int fmode)
return fd;
if (errno == EAGAIN || errno == EBUSY)
return fd;
return rsm_open_device(filename, fmode);
if (! access(filename, F_OK))
return rsm_open_device(filename, fmode);
return -1;
}
#else
#define snd_open_device(filename, fmode) open(filename, fmode);