summaryrefslogtreecommitdiff
path: root/usr.bin/sndiod/sock.c
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2018-06-26 07:12:36 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2018-06-26 07:12:36 +0000
commit14a453006047f0dd6658d515709d85b323c48d6f (patch)
treebbccc9ba83e1273db1e26f372a692c4dd29eeab7 /usr.bin/sndiod/sock.c
parentf0351b3940f767834da62e721812186db45bca14 (diff)
Replace the gloal opt list with per-device lists.
Diffstat (limited to 'usr.bin/sndiod/sock.c')
-rw-r--r--usr.bin/sndiod/sock.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.bin/sndiod/sock.c b/usr.bin/sndiod/sock.c
index b22b7322772..d9db6158c1c 100644
--- a/usr.bin/sndiod/sock.c
+++ b/usr.bin/sndiod/sock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sock.c,v 1.21 2018/01/10 09:05:48 ratchov Exp $ */
+/* $OpenBSD: sock.c,v 1.22 2018/06/26 07:12:35 ratchov Exp $ */
/*
* Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org>
*
@@ -842,14 +842,17 @@ sock_hello(struct sock *f)
return 0;
return 1;
}
- f->opt = opt_byname(p->opt, p->devnum);
+ d = dev_bynum(p->devnum);
+ if (d == NULL)
+ return 0;
+ f->opt = opt_byname(d, p->opt);
if (f->opt == NULL)
return 0;
#ifdef DEBUG
if (log_level >= 3) {
sock_log(f);
log_puts(": using ");
- dev_log(f->opt->dev);
+ dev_log(d);
log_puts(".");
log_puts(f->opt->name);
log_puts(", mode = ");
@@ -868,7 +871,7 @@ sock_hello(struct sock *f)
}
return 0;
}
- s = slot_new(f->opt->dev, p->who, &sock_slotops, f, mode);
+ s = slot_new(d, p->who, &sock_slotops, f, mode);
if (s == NULL)
return 0;
f->midi = NULL;