summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorratchov <ratchov@openbsd.org>2011-11-16 21:26:55 +0000
committerratchov <ratchov@openbsd.org>2011-11-16 21:26:55 +0000
commit2eb749f5113b1e750f4eecb8e070443339f6ed6b (patch)
tree5c6ffa4e756714342e7ece209e063adf50e122f3
parentprefix device-specific messages by the device name, since we (diff)
downloadwireguard-openbsd-2eb749f5113b1e750f4eecb8e070443339f6ed6b.tar.xz
wireguard-openbsd-2eb749f5113b1e750f4eecb8e070443339f6ed6b.zip
mark the device as closed before closing streams attached to it.
otherwise a stream may try to close the device a second time.
-rw-r--r--usr.bin/aucat/dev.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.bin/aucat/dev.c b/usr.bin/aucat/dev.c
index 54d79aeb878..ef851ca85d7 100644
--- a/usr.bin/aucat/dev.c
+++ b/usr.bin/aucat/dev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dev.c,v 1.69 2011/11/16 21:22:17 ratchov Exp $ */
+/* $OpenBSD: dev.c,v 1.70 2011/11/16 21:26:55 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -543,7 +543,7 @@ dev_close(struct dev *d)
dbg_puts(": closing device\n");
}
#endif
-
+ d->pstate = DEV_CLOSED;
if (d->mix) {
/*
* Put the mixer in ``autoquit'' state and generate
@@ -649,7 +649,6 @@ dev_close(struct dev *d)
aproc_del(d->midi);
d->midi = NULL;
}
- d->pstate = DEV_CLOSED;
}
/*