diff options
author | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2021-03-08 09:38:37 +0000 |
---|---|---|
committer | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2021-03-08 09:38:37 +0000 |
commit | 414ac93b71ae716bfc8a41ca33bd7ed0c8e34f54 (patch) | |
tree | f0bbf383cd00b04f337802caee5943e3690d447c /usr.bin/sndiod/dev.c | |
parent | 31c8ce47afbc61c474c348600ad30e7376562764 (diff) |
sndiod: Initialize dev->master_enabled earlier
This is better style as since recently dev->master_enabled is used by
the ctlslot_xxx family functions which -- in the future -- could be
called with the device closed.
No behavior change.
Diffstat (limited to 'usr.bin/sndiod/dev.c')
-rw-r--r-- | usr.bin/sndiod/dev.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/sndiod/dev.c b/usr.bin/sndiod/dev.c index 798f1565a0a..725732c91ba 100644 --- a/usr.bin/sndiod/dev.c +++ b/usr.bin/sndiod/dev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dev.c,v 1.95 2021/03/08 09:35:08 ratchov Exp $ */ +/* $OpenBSD: dev.c,v 1.96 2021/03/08 09:38:36 ratchov Exp $ */ /* * Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org> * @@ -941,6 +941,7 @@ dev_new(char *path, struct aparams *par, d->pstate = DEV_CFG; d->slot_list = NULL; d->master = MIDI_MAXCTL; + d->master_enabled = 0; snprintf(d->name, CTL_NAMEMAX, "%u", d->num); d->next = dev_list; dev_list = d; @@ -1093,7 +1094,6 @@ dev_open(struct dev *d) char name[CTL_NAMEMAX]; struct dev_alt *a; - d->master_enabled = 0; d->mode = d->reqmode; d->round = d->reqround; d->bufsz = d->reqbufsz; |