From: ratchov Date: Mon, 8 Mar 2021 09:38:36 +0000 (+0000) Subject: sndiod: Initialize dev->master_enabled earlier X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=2e623beb852068a3287fc94728e9384e231f281a;p=openbsd 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. --- 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 * @@ -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;