[Scummvm-cvs-logs] SF.net SVN: scummvm:[55851] scummvm/trunk/backends/midi/seq.cpp
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Wed Feb 9 02:11:58 CET 2011
Revision: 55851
http://scummvm.svn.sourceforge.net/scummvm/?rev=55851&view=rev
Author: fingolfin
Date: 2011-02-09 01:11:58 +0000 (Wed, 09 Feb 2011)
Log Message:
-----------
MIDI: Fix bug #3153076 (warnings in SEQ driver)
Modified Paths:
--------------
scummvm/trunk/backends/midi/seq.cpp
Modified: scummvm/trunk/backends/midi/seq.cpp
===================================================================
--- scummvm/trunk/backends/midi/seq.cpp 2011-02-09 01:09:01 UTC (rev 55850)
+++ scummvm/trunk/backends/midi/seq.cpp 2011-02-09 01:11:58 UTC (rev 55851)
@@ -41,6 +41,7 @@
#include <fcntl.h>
#include <unistd.h>
+#include <errno.h>
////////////////////////////////////////
//
@@ -85,7 +86,7 @@
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 @@
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 @@
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);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list