=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/sndiod/sndiod.c,v retrieving revision 1.38 retrieving revision 1.39 diff -u -r1.38 -r1.39 --- src/usr.bin/sndiod/sndiod.c 2020/02/26 13:53:58 1.38 +++ src/usr.bin/sndiod/sndiod.c 2020/04/01 16:54:17 1.39 @@ -1,4 +1,4 @@ -/* $OpenBSD: sndiod.c,v 1.38 2020/02/26 13:53:58 ratchov Exp $ */ +/* $OpenBSD: sndiod.c,v 1.39 2020/04/01 16:54:17 ratchov Exp $ */ /* * Copyright (c) 2008-2012 Alexandre Ratchov * @@ -119,6 +119,15 @@ "[-v volume] [-w flag] [-z nframes]\n"; /* + * default MIDI ports + */ +static char *default_ports[] = { + "rmidi/0", "rmidi/1", "rmidi/2", "rmidi/3", + "rmidi/4", "rmidi/5", "rmidi/6", "rmidi/7", + NULL +}; + +/* * 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 * is blocked somewhere, so exit. @@ -445,7 +454,7 @@ int main(int argc, char **argv) { - int c, background, unit; + int c, i, background, unit; int pmin, pmax, rmin, rmax; char base[SOCKPATH_MAX], path[SOCKPATH_MAX]; unsigned int mode, dup, mmc, vol; @@ -582,6 +591,10 @@ if (argc > 0) { fputs(usagestr, stderr); return 1; + } + if (port_list == NULL) { + for (i = 0; default_ports[i] != NULL; i++) + mkport(default_ports[i], 0); } if (dev_list == NULL) mkdev(DEFAULT_DEV, &par, 0, bufsz, round, rate, hold, autovol);