From 787599174b79e80a5ab6b2c27c543b1bed5b34c8 Mon Sep 17 00:00:00 2001 From: Alexandre Ratchov Date: Thu, 27 Jan 2011 20:37:20 +0000 Subject: while closing the device, don't sleep with the PCATCH flag, otherwise a signal (like SIGALRM) may cause the output buffer to not be drained and causing for instance stale notes. --- sys/dev/midi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/dev/midi.c') diff --git a/sys/dev/midi.c b/sys/dev/midi.c index 6ff0165d4f2..ae6644e50e9 100644 --- a/sys/dev/midi.c +++ b/sys/dev/midi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: midi.c,v 1.24 2011/01/01 16:34:42 ratchov Exp $ */ +/* $OpenBSD: midi.c,v 1.25 2011/01/27 20:37:19 ratchov Exp $ */ /* * Copyright (c) 2003, 2004 Alexandre Ratchov @@ -544,7 +544,7 @@ midiclose(dev_t dev, int fflag, int devtype, struct proc *p) midi_out_start(sc); while (sc->isbusy) { sc->wchan = 1; - error = tsleep(&sc->wchan, PWAIT|PCATCH, "mid_dr", 0); + error = tsleep(&sc->wchan, PWAIT, "mid_dr", 5 * hz); if (error || sc->isdying) break; } @@ -560,7 +560,7 @@ midiclose(dev_t dev, int fflag, int devtype, struct proc *p) * Note: we'd better sleep in the corresponding hw_if->close() */ - tsleep(&sc->wchan, PWAIT|PCATCH, "mid_cl", 2 * sc->wait); + tsleep(&sc->wchan, PWAIT, "mid_cl", 2 * sc->wait); sc->hw_if->close(sc->hw_hdl); sc->isopen = 0; return 0; -- cgit v1.2.3