diff options
author | 2021-03-08 09:38:36 +0000 | |
---|---|---|
committer | 2021-03-08 09:38:36 +0000 | |
commit | 2e623beb852068a3287fc94728e9384e231f281a (patch) | |
tree | 81a9f66dd17377bd87c4e4ff78ffe888a33348fc | |
parent | sndiod: Style tweak: uniformize pattern to access ctlslot_array (diff) | |
download | wireguard-openbsd-2e623beb852068a3287fc94728e9384e231f281a.tar.xz wireguard-openbsd-2e623beb852068a3287fc94728e9384e231f281a.zip |
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.
-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; |