diff options
author | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2011-01-27 20:37:20 +0000 |
---|---|---|
committer | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2011-01-27 20:37:20 +0000 |
commit | 787599174b79e80a5ab6b2c27c543b1bed5b34c8 (patch) | |
tree | 209a0118ed2575458f52ea4291d87f01b775b720 /sys/dev | |
parent | 77e1ec36c6229b77655ecadffe5e8f0b97ecef87 (diff) |
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.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/midi.c | 6 |
1 files changed, 3 insertions, 3 deletions
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; |