aboutsummaryrefslogtreecommitdiff
path: root/backends/midi
diff options
context:
space:
mode:
authorMax Horn2011-02-09 11:03:36 +0000
committerMax Horn2011-02-09 11:03:36 +0000
commit77fe90d95e8b73fc254eabd90719b36ecb15b128 (patch)
tree82171732f66f74625b318a1b89594c4803d3b36c /backends/midi
parent8bde4ab0af138133ea514bd72b9a5504c4c11d77 (diff)
downloadscummvm-rg350-77fe90d95e8b73fc254eabd90719b36ecb15b128.tar.gz
scummvm-rg350-77fe90d95e8b73fc254eabd90719b36ecb15b128.tar.bz2
scummvm-rg350-77fe90d95e8b73fc254eabd90719b36ecb15b128.zip
MIDI: Really fix bug #3153076 (this time also for Timidity)
svn-id: r55857
Diffstat (limited to 'backends/midi')
-rw-r--r--backends/midi/seq.cpp10
-rw-r--r--backends/midi/timidity.cpp6
2 files changed, 9 insertions, 7 deletions
diff --git a/backends/midi/seq.cpp b/backends/midi/seq.cpp
index b1c133e787..064129b74a 100644
--- a/backends/midi/seq.cpp
+++ b/backends/midi/seq.cpp
@@ -148,9 +148,8 @@ void MidiDriver_SEQ::send(uint32 b) {
warning("MidiDriver_SEQ::send: unknown : %08x", (int)b);
break;
}
- ssize_t out = write(device, buf, position);
- if (out == -1)
- warning("MidiDriver_SEQ::send: write failed (errno %d)", errno);
+ if (write(device, buf, position) == -1)
+ warning("MidiDriver_SEQ::send: write failed (%s)", strerror(errno));
}
void MidiDriver_SEQ::sysEx(const byte *msg, uint16 length) {
@@ -175,9 +174,8 @@ void MidiDriver_SEQ::sysEx(const byte *msg, uint16 length) {
buf[position++] = _device_num;
buf[position++] = 0;
- ssize_t out = write(device, buf, position);
- if (out == -1)
- warning("MidiDriver_SEQ::sysEx: write failed (errno %d)", errno);
+ if (write(device, buf, position) == -1)
+ warning("MidiDriver_SEQ::send: write failed (%s)", strerror(errno));
}
diff --git a/backends/midi/timidity.cpp b/backends/midi/timidity.cpp
index 4c0cefa156..eeaf872747 100644
--- a/backends/midi/timidity.cpp
+++ b/backends/midi/timidity.cpp
@@ -337,7 +337,11 @@ char *MidiDriver_TIMIDITY::timidity_ctl_command(const char *fmt, ...) {
buff[len++] = '\n';
/* write command to control socket */
- write(_control_fd, buff, len);
+ if (write(_control_fd, buff, len) == -1) {
+ warning("TiMidity: CONTROL WRITE FAILED (%s)", strerror(errno));
+ // TODO: Disable output?
+ //close_all();
+ }
}
while (1) {