diff options
author | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2008-06-02 17:04:33 +0000 |
---|---|---|
committer | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2008-06-02 17:04:33 +0000 |
commit | af8d1222b93dc5a82cc0a0e32e4ab53529cea230 (patch) | |
tree | 7915e18bd8a4f9971a83237013b0756d2213c68e /usr.bin/aucat | |
parent | 22932c2094356d157dcfb5ad2433dabbe584f4f5 (diff) |
(remove -d, first part) replace -d flag by AUCAT_DEBUG environment
variable. This eases turning debugging on/off when aucat is started by
another program.
"i like the idea" jakemsr
Diffstat (limited to 'usr.bin/aucat')
-rw-r--r-- | usr.bin/aucat/aucat.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/usr.bin/aucat/aucat.c b/usr.bin/aucat/aucat.c index cd720e354c4..499f332a156 100644 --- a/usr.bin/aucat/aucat.c +++ b/usr.bin/aucat/aucat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aucat.c,v 1.18 2008/05/26 08:32:11 jmc Exp $ */ +/* $OpenBSD: aucat.c,v 1.19 2008/06/02 17:04:32 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org> * @@ -351,13 +351,20 @@ main(int argc, char **argv) struct aparams ipar, opar, dipar, dopar, cipar, copar; unsigned ivol, ovol; unsigned dinfr, donfr, cinfr, confr; - char *devpath; + char *devpath, *dbgenv; unsigned n; struct aproc *rec, *play, *mix, *sub, *conv; struct file *dev, *f; struct abuf *buf, *cbuf; int fd; + dbgenv = getenv("AUCAT_DEBUG"); + if (dbgenv) { + if (sscanf(dbgenv, "%u", &debug_level) != 1 || + debug_level > 4) + err(1, "%s: not an integer in the 0..4 range", dbgenv); + } + aparams_init(&ipar, 0, 1, 44100); aparams_init(&opar, 0, 1, 44100); @@ -368,14 +375,8 @@ main(int argc, char **argv) ihdr = ohdr = HDR_AUTO; ivol = ovol = MIDI_TO_ADATA(127); - while ((c = getopt(argc, argv, "d:c:C:e:E:r:R:h:H:i:o:f:qu")) != -1) { + while ((c = getopt(argc, argv, "c:C:e:E:r:R:h:H:i:o:f:qu")) != -1) { switch (c) { - case 'd': - if (sscanf(optarg, "%u", &debug_level) != 1 || - debug_level > 4) - err(1, "%s: not an integer in the 0..4 range", - optarg); - break; case 'h': ihdr = opt_hdr(); break; |