summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2012-05-23 19:25:12 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2012-05-23 19:25:12 +0000
commit298f5ad9040c0b93ccd39f1e110caab2684070a4 (patch)
treed25cfab90de9052fd97269b828e99beabbe85cbc /usr.bin
parent6512e92d37b1b4f867171e80f8d8574b6f22912a (diff)
Make the "default" string a valid device name that has the same effect
as NULL has. This will (hopefully) simplify ports where the user passes the device string.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/aucat/aucat.c5
-rw-r--r--usr.bin/aucat/miofile.c6
-rw-r--r--usr.bin/aucat/siofile.c10
3 files changed, 9 insertions, 12 deletions
diff --git a/usr.bin/aucat/aucat.c b/usr.bin/aucat/aucat.c
index 1412980c4a1..82fff7b408b 100644
--- a/usr.bin/aucat/aucat.c
+++ b/usr.bin/aucat/aucat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aucat.c,v 1.134 2012/04/11 06:05:43 ratchov Exp $ */
+/* $OpenBSD: aucat.c,v 1.135 2012/05/23 19:25:11 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -26,6 +26,7 @@
#include <limits.h>
#include <pwd.h>
#include <signal.h>
+#include <sndio.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -349,7 +350,7 @@ mkdev(char *path, int mode, int bufsz, int round, int hold, int autovol)
} else {
if (dev_list)
return dev_list;
- path = "default";
+ path = SIO_DEVANY;
}
if (!bufsz && !round) {
round = DEFAULT_ROUND;
diff --git a/usr.bin/aucat/miofile.c b/usr.bin/aucat/miofile.c
index 6238bbb5065..3acdc2eb2b7 100644
--- a/usr.bin/aucat/miofile.c
+++ b/usr.bin/aucat/miofile.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: miofile.c,v 1.7 2012/04/11 06:05:43 ratchov Exp $ */
+/* $OpenBSD: miofile.c,v 1.8 2012/05/23 19:25:11 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -64,12 +64,10 @@ struct fileops miofile_ops = {
struct miofile *
miofile_new(struct fileops *ops, char *path, unsigned int mode)
{
- char *siopath;
struct mio_hdl *hdl;
struct miofile *f;
- siopath = (strcmp(path, "default") == 0) ? NULL : path;
- hdl = mio_open(siopath, mode, 1);
+ hdl = mio_open(path, mode, 1);
if (hdl == NULL)
return NULL;
f = (struct miofile *)file_new(ops, path, mio_nfds(hdl));
diff --git a/usr.bin/aucat/siofile.c b/usr.bin/aucat/siofile.c
index 2517f0f9734..426c9e34281 100644
--- a/usr.bin/aucat/siofile.c
+++ b/usr.bin/aucat/siofile.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: siofile.c,v 1.10 2012/04/11 06:05:43 ratchov Exp $ */
+/* $OpenBSD: siofile.c,v 1.11 2012/05/23 19:25:11 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -209,22 +209,20 @@ siofile_new(struct fileops *ops, char *path, unsigned int *rmode,
struct aparams *ipar, struct aparams *opar,
unsigned int *bufsz, unsigned int *round)
{
- char *siopath;
struct sio_par par;
struct sio_hdl *hdl;
struct siofile *f;
unsigned int mode = *rmode;
- siopath = (strcmp(path, "default") == 0) ? NULL : path;
- hdl = sio_open(siopath, mode, 1);
+ hdl = sio_open(path, mode, 1);
if (hdl == NULL) {
if (mode != (SIO_PLAY | SIO_REC))
return NULL;
- hdl = sio_open(siopath, SIO_PLAY, 1);
+ hdl = sio_open(path, SIO_PLAY, 1);
if (hdl != NULL)
mode = SIO_PLAY;
else {
- hdl = sio_open(siopath, SIO_REC, 1);
+ hdl = sio_open(path, SIO_REC, 1);
if (hdl != NULL)
mode = SIO_REC;
else