=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/sndiod/sndiod.c,v retrieving revision 1.12 retrieving revision 1.13 diff -c -r1.12 -r1.13 *** src/usr.bin/sndiod/sndiod.c 2015/11/18 08:36:20 1.12 --- src/usr.bin/sndiod/sndiod.c 2015/11/22 16:52:06 1.13 *************** *** 1,4 **** ! /* $OpenBSD: sndiod.c,v 1.12 2015/11/18 08:36:20 ratchov Exp $ */ /* * Copyright (c) 2008-2012 Alexandre Ratchov * --- 1,4 ---- ! /* $OpenBSD: sndiod.c,v 1.13 2015/11/22 16:52:06 ratchov Exp $ */ /* * Copyright (c) 2008-2012 Alexandre Ratchov * *************** *** 333,339 **** { int c, background, unit; int pmin, pmax, rmin, rmax; ! char base[SOCKPATH_MAX], path[SOCKPATH_MAX]; unsigned int mode, dup, mmc, vol; unsigned int hold, autovol, bufsz, round, rate; const char *str; --- 333,339 ---- { int c, background, unit; int pmin, pmax, rmin, rmax; ! char base[SOCKPATH_MAX], path[SOCKPATH_MAX], *tcpaddr; unsigned int mode, dup, mmc, vol; unsigned int hold, autovol, bufsz, round, rate; const char *str; *************** *** 363,368 **** --- 363,369 ---- rmax = 1; aparams_init(&par); mode = MODE_PLAY | MODE_REC; + tcpaddr = NULL; setsig(); filelist_init(); *************** *** 381,391 **** errx(1, "%s: unit number is %s", optarg, str); break; case 'L': ! #ifdef USE_TCP ! listen_new_tcp(optarg, AUCAT_PORT + unit); ! #else ! errx(1, "-L option disabled at compilation time"); ! #endif break; case 'm': mode = opt_mode(); --- 382,388 ---- errx(1, "%s: unit number is %s", optarg, str); break; case 'L': ! tcpaddr = optarg; break; case 'm': mode = opt_mode(); *************** *** 472,477 **** --- 469,481 ---- getbasepath(base, sizeof(base)); snprintf(path, SOCKPATH_MAX, "%s/" SOCKPATH_FILE "%u", base, unit); listen_new_un(path); + if (tcpaddr) { + #ifdef USE_TCP + listen_new_tcp(optarg, AUCAT_PORT + unit); + #else + errx(1, "-L option disabled at compilation time"); + #endif + } if (geteuid() == 0) privdrop(); midi_init();