diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1999-02-15 02:15:32 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1999-02-15 02:15:32 +0000 |
commit | 86464aed71025541805e7b1515541aee89879e33 (patch) | |
tree | e01a457a4912a8553bc65524aa3125d51f29f810 /drivers/sound/midibuf.c | |
parent | 88f99939ecc6a95a79614574cb7d95ffccfc3466 (diff) |
Merge with Linux 2.2.1.
Diffstat (limited to 'drivers/sound/midibuf.c')
-rw-r--r-- | drivers/sound/midibuf.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/sound/midibuf.c b/drivers/sound/midibuf.c index 7adfeb89c..b1c9763e5 100644 --- a/drivers/sound/midibuf.c +++ b/drivers/sound/midibuf.c @@ -40,7 +40,7 @@ struct midi_buf struct midi_parms { - int prech_timeout; /* + long prech_timeout; /* * Timeout before the first ch */ }; @@ -282,8 +282,14 @@ int MIDIbuf_write(int dev, struct file *file, const char *buf, int count) n = SPACE_AVAIL(midi_out_buf[dev]); if (n == 0) { /* - * No space just now. We have to sleep + * No space just now. */ + + if (file->f_flags & O_NONBLOCK) { + restore_flags(flags); + return -EAGAIN; + } + interruptible_sleep_on(&midi_sleeper[dev]); if (signal_pending(current)) { @@ -322,6 +328,10 @@ int MIDIbuf_read(int dev, struct file *file, char *buf, int count) if (!DATA_AVAIL(midi_in_buf[dev])) { /* * No data yet, wait */ + if (file->f_flags & O_NONBLOCK) { + restore_flags(flags); + return -EAGAIN; + } interruptible_sleep_on_timeout(&input_sleeper[dev], parms[dev].prech_timeout); |