summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libsndio/sndio.c4
-rw-r--r--lib/libsndio/sun.c9
2 files changed, 6 insertions, 7 deletions
diff --git a/lib/libsndio/sndio.c b/lib/libsndio/sndio.c
index afc9b36013c..cccc38905ee 100644
--- a/lib/libsndio/sndio.c
+++ b/lib/libsndio/sndio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sndio.c,v 1.6 2008/11/11 19:39:35 ratchov Exp $ */
+/* $OpenBSD: sndio.c,v 1.7 2008/11/20 16:31:26 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -164,6 +164,8 @@ sio_open(char *str, unsigned mode, int nbio)
if ((mode & (SIO_PLAY | SIO_REC)) == 0)
return NULL;
+ if (str == NULL)
+ str = getenv("AUDIODEVICE");
hdl = sio_open_aucat(str, mode, nbio);
if (hdl != NULL)
return hdl;
diff --git a/lib/libsndio/sun.c b/lib/libsndio/sun.c
index 079ec9a5391..5b4db13842b 100644
--- a/lib/libsndio/sun.c
+++ b/lib/libsndio/sun.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sun.c,v 1.6 2008/11/20 08:32:03 ratchov Exp $ */
+/* $OpenBSD: sun.c,v 1.7 2008/11/20 16:31:26 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -453,11 +453,8 @@ sio_open_sun(char *path, unsigned mode, int nbio)
return NULL;
sio_create(&hdl->sa, &sun_ops, mode, nbio);
- if (path == NULL) {
- path = getenv("AUDIODEVICE");
- if (path == NULL)
- path = SIO_SUN_PATH;
- }
+ if (path == NULL)
+ path = SIO_SUN_PATH;
if (mode == (SIO_PLAY | SIO_REC))
flags = O_RDWR;
else