From 414ac93b71ae716bfc8a41ca33bd7ed0c8e34f54 Mon Sep 17 00:00:00 2001 From: Alexandre Ratchov Date: Mon, 8 Mar 2021 09:38:37 +0000 Subject: 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. --- usr.bin/sndiod/dev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.bin/sndiod/dev.c') 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; -- cgit v1.2.3