Make sure OSS device files exist before adding them

This commit is contained in:
Chris Robinson
2017-07-23 16:38:54 -07:00
parent 4ec67e6226
commit 5ab4e584ee
+10 -2
View File
@@ -821,7 +821,11 @@ void ALCossBackendFactory_probe(ALCossBackendFactory* UNUSED(self), enum DevProb
cur = &oss_playback;
while(cur != NULL)
{
AppendAllDevicesList(cur->handle);
#ifdef HAVE_STAT
struct stat buf;
if(stat(cur->path, &buf) == 0)
#endif
AppendAllDevicesList(cur->handle);
cur = cur->next;
}
break;
@@ -832,7 +836,11 @@ void ALCossBackendFactory_probe(ALCossBackendFactory* UNUSED(self), enum DevProb
cur = &oss_capture;
while(cur != NULL)
{
AppendCaptureDeviceList(cur->handle);
#ifdef HAVE_STAT
struct stat buf;
if(stat(cur->path, &buf) == 0)
#endif
AppendCaptureDeviceList(cur->handle);
cur = cur->next;
}
break;