aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-07-23 16:38:54 -0700
committerChris Robinson <[email protected]>2017-07-23 16:38:54 -0700
commit5ab4e584eec469708a14df9effe1e038df805f8b (patch)
tree108ddd87ebce7d207bf0dfe7f63fa7ee464f9892
parent4ec67e6226e956d8f87c67976d3c6b07c8d2fb2c (diff)
Make sure OSS device files exist before adding them
-rw-r--r--Alc/backends/oss.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/Alc/backends/oss.c b/Alc/backends/oss.c
index 33ea55eb..f99ca0d2 100644
--- a/Alc/backends/oss.c
+++ b/Alc/backends/oss.c
@@ -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;