summaryrefslogtreecommitdiffstats
path: root/libjava/classpath/native/jni/midi-alsa
diff options
context:
space:
mode:
authorgandalf <gandalf@138bc75d-0d04-0410-961f-82ee72b054a4>2012-03-23 15:19:26 +0000
committergandalf <gandalf@138bc75d-0d04-0410-961f-82ee72b054a4>2012-03-23 15:19:26 +0000
commit5c7411981584e487ac41794feb98a66df9fd6fcb (patch)
treefebe3d4d4c0c994db223fee8e819bde6582494c9 /libjava/classpath/native/jni/midi-alsa
parent112dfe9f689af01c2dd00e0f153fc25d69095b6c (diff)
downloadppe42-gcc-5c7411981584e487ac41794feb98a66df9fd6fcb.tar.gz
ppe42-gcc-5c7411981584e487ac41794feb98a66df9fd6fcb.zip
Merge GNU Classpath 0.99 into libjava.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@185741 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/native/jni/midi-alsa')
-rw-r--r--libjava/classpath/native/jni/midi-alsa/gnu_javax_sound_midi_alsa_AlsaPortDevice.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/libjava/classpath/native/jni/midi-alsa/gnu_javax_sound_midi_alsa_AlsaPortDevice.c b/libjava/classpath/native/jni/midi-alsa/gnu_javax_sound_midi_alsa_AlsaPortDevice.c
index d3e4f2b45a0..5916eb29bdd 100644
--- a/libjava/classpath/native/jni/midi-alsa/gnu_javax_sound_midi_alsa_AlsaPortDevice.c
+++ b/libjava/classpath/native/jni/midi-alsa/gnu_javax_sound_midi_alsa_AlsaPortDevice.c
@@ -1,5 +1,5 @@
/* gnu_javax_sound_midi_alsa_AlsaPortDevice.c - Native support
- Copyright (C) 2005, 2010
+ Copyright (C) 2005, 2010, 2011
Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,6 +41,7 @@ exception statement from your version. */
#include <gnu_javax_sound_midi_alsa_AlsaPortDevice.h>
#include <unistd.h>
+#include <jcl.h>
#include <alsa/asoundlib.h>
JNIEXPORT void JNICALL
@@ -48,6 +49,7 @@ Java_gnu_javax_sound_midi_alsa_AlsaPortDevice_run_1receiver_1thread_1
(JNIEnv *env, jobject this __attribute__((unused)),
jlong client, jlong port, jobject receiver)
{
+ int rc;
snd_seq_port_info_t *pinfo, *sinfo;
snd_seq_port_subscribe_t *subs;
snd_seq_addr_t sender, dest;
@@ -57,12 +59,16 @@ Java_gnu_javax_sound_midi_alsa_AlsaPortDevice_run_1receiver_1thread_1
snd_seq_port_info_alloca (&sinfo);
snd_seq_port_subscribe_alloca (&subs);
- snd_seq_open (&seq, "default", SND_SEQ_OPEN_DUPLEX, SND_SEQ_NONBLOCK);
+ rc = snd_seq_open (&seq, "default", SND_SEQ_OPEN_DUPLEX, SND_SEQ_NONBLOCK);
+ if (rc < 0)
+ JCL_ThrowException (env, "java/lang/InternalError", snd_strerror (rc));
snd_seq_port_info_set_capability (pinfo, SND_SEQ_PORT_CAP_WRITE);
snd_seq_port_info_set_type (pinfo, SND_SEQ_PORT_TYPE_MIDI_GENERIC);
- snd_seq_create_port (seq, pinfo);
+ rc = snd_seq_create_port (seq, pinfo);
+ if (rc < 0)
+ JCL_ThrowException (env, "java/lang/InternalError", snd_strerror (rc));
sender.client = (int) client;
sender.port = (int) port;
@@ -71,7 +77,9 @@ Java_gnu_javax_sound_midi_alsa_AlsaPortDevice_run_1receiver_1thread_1
snd_seq_port_subscribe_set_sender (subs, &sender);
snd_seq_port_subscribe_set_dest (subs, &dest);
- snd_seq_subscribe_port(seq, subs);
+ rc = snd_seq_subscribe_port(seq, subs);
+ if (rc < 0)
+ JCL_ThrowException (env, "java/lang/InternalError", snd_strerror (rc));
{
int npfd;
OpenPOWER on IntegriCloud