aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2011-02-09 01:11:58 +0000
committerMax Horn2011-02-09 01:11:58 +0000
commitab78737abd273b02c5d9606493e57265dd2357aa (patch)
treedb6a3cf78d6dc6b9a71c9d1485b62c95704edead
parent42ab839dd6c8a1570b232101eb97f4e54de57935 (diff)
downloadscummvm-rg350-ab78737abd273b02c5d9606493e57265dd2357aa.tar.gz
scummvm-rg350-ab78737abd273b02c5d9606493e57265dd2357aa.tar.bz2
scummvm-rg350-ab78737abd273b02c5d9606493e57265dd2357aa.zip
MIDI: Fix bug #3153076 (warnings in SEQ driver)
svn-id: r55851
-rw-r--r--backends/midi/seq.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/backends/midi/seq.cpp b/backends/midi/seq.cpp
index cc514117fb..b1c133e787 100644
--- a/backends/midi/seq.cpp
+++ b/backends/midi/seq.cpp
@@ -41,6 +41,7 @@
#include <fcntl.h>
#include <unistd.h>
+#include <errno.h>
////////////////////////////////////////
//
@@ -85,7 +86,7 @@ int MidiDriver_SEQ::open() {
device_name = dev_seq;
}
- device = (::open((device_name), O_RDWR, 0));
+ device = ::open((device_name), O_RDWR, 0);
if ((device_name == NULL) || (device < 0)) {
if (device_name == NULL)
@@ -147,10 +148,12 @@ void MidiDriver_SEQ::send(uint32 b) {
warning("MidiDriver_SEQ::send: unknown : %08x", (int)b);
break;
}
- write(device, buf, position);
+ ssize_t out = write(device, buf, position);
+ if (out == -1)
+ warning("MidiDriver_SEQ::send: write failed (errno %d)", errno);
}
-void MidiDriver_SEQ::sysEx (const byte *msg, uint16 length) {
+void MidiDriver_SEQ::sysEx(const byte *msg, uint16 length) {
unsigned char buf [266*4];
int position = 0;
const byte *chr = msg;
@@ -172,7 +175,9 @@ void MidiDriver_SEQ::sysEx (const byte *msg, uint16 length) {
buf[position++] = _device_num;
buf[position++] = 0;
- write(device, buf, position);
+ ssize_t out = write(device, buf, position);
+ if (out == -1)
+ warning("MidiDriver_SEQ::sysEx: write failed (errno %d)", errno);
}