=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/aucat/aucat.c,v retrieving revision 1.128 retrieving revision 1.129 diff -u -r1.128 -r1.129 --- src/usr.bin/aucat/aucat.c 2011/12/02 12:45:29 1.128 +++ src/usr.bin/aucat/aucat.c 2011/12/09 14:36:42 1.129 @@ -1,4 +1,4 @@ -/* $OpenBSD: aucat.c,v 1.128 2011/12/02 12:45:29 ratchov Exp $ */ +/* $OpenBSD: aucat.c,v 1.129 2011/12/09 14:36:42 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov * @@ -56,6 +56,7 @@ #define SNDIO_PRIO (-20) #define PROG_AUCAT "aucat" +#define PROG_SNDIOD "sndiod" /* * sample rate if no ``-r'' is used @@ -83,13 +84,18 @@ #endif volatile sig_atomic_t quit_flag = 0; -char aucat_usage[] = "usage: " PROG_AUCAT " [-dlMn] [-a flag] [-b nframes] " +char aucat_usage[] = "usage: " PROG_AUCAT " [-dlMn] [-b nframes] " "[-C min:max] [-c min:max] [-e enc]\n\t" - "[-f device] [-h fmt] [-i file] [-j flag] [-L addr] [-m mode] " - "[-o file]\n\t" - "[-q port] [-r rate] [-s name] [-t mode] [-U unit] [-v volume]\n\t" - "[-w flag] [-x policy] [-z nframes]\n"; + "[-f device] [-h fmt] [-i file] [-j flag] [-m mode] [-o file]\n\t" + "[-q port] [-r rate] [-t mode] [-v volume] [-w flag] [-x policy]\n\t" + "[-z nframes]\n"; +char sndiod_usage[] = "usage: " PROG_SNDIOD " [-dlM] [-a flag] [-b nframes] " + "[-C min:max] [-c min:max] [-e enc]\n\t" + "[-f device] [-j flag] [-L addr] [-m mode] [-q port] [-r rate]\n\t" + "[-s name] [-t mode] [-U unit] [-v volume] [-w flag] [-x policy]\n\t" + "[-z nframes]\n"; + /* * SIGINT handler, it raises the quit flag. If the flag is already set, * that means that the last SIGINT was not handled, because the process @@ -415,6 +421,11 @@ if (strcmp(prog, PROG_AUCAT) == 0) { optstr = "a:b:c:C:de:f:h:i:j:lL:m:Mno:q:r:s:t:U:v:w:x:z:"; usagestr = aucat_usage; + } else if (strcmp(prog, PROG_SNDIOD) == 0) { + optstr = "a:b:c:C:de:f:j:L:m:Mq:r:s:t:U:v:w:x:z:"; + usagestr = sndiod_usage; + background = 1; + hold = 0; } else { fprintf(stderr, "%s: can't determine program to run\n", prog); return 1; @@ -427,6 +438,7 @@ if (debug_level < 4) debug_level++; #endif + background = 0; break; case 'U': if (listen_list) @@ -493,7 +505,7 @@ dev_adjpar(d, w->mode, &w->hpar, NULL); break; case 's': - d = mkdev(NULL, 0, bufsz, round, 1, autovol); + d = mkdev(DEFAULT_DEV, 0, bufsz, round, 1, autovol); mkopt(optarg, d, &rpar, &ppar, mode, vol, mmc, join); /* XXX: set device rate, if never set */