From: Takashi Iwai Date: Mon, 20 Feb 2006 19:32:53 +0000 (+0000) Subject: Avoid unnecesasry call of resmgr X-Git-Tag: v1.0.11rc4~29 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=609d4a7de6a9122bb944f95522e1bae45df8a7fc;p=alsa-lib.git Avoid unnecesasry call of resmgr Avoid unnecesasry call of resmgr if the device file really doesn't exist. --- diff --git a/include/local.h b/include/local.h index b18d77a9..01b79ca2 100644 --- a/include/local.h +++ b/include/local.h @@ -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);