]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Avoid unnecesasry call of resmgr
authorTakashi Iwai <tiwai@suse.de>
Mon, 20 Feb 2006 19:32:53 +0000 (19:32 +0000)
committerTakashi Iwai <tiwai@suse.de>
Mon, 20 Feb 2006 19:32:53 +0000 (19:32 +0000)
Avoid unnecesasry call of resmgr if the device file really doesn't exist.

include/local.h

index b18d77a9699503a0ecc31557394ac4af13ec5427..01b79ca2accdb192583c2086ffb194aa826d4bf3 100644 (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);