diff options
author | Dalibor Topic <robilad@yahoo.com> | 2006-11-26 20:51:57 +0000 |
---|---|---|
committer | Dalibor Topic <robilad@yahoo.com> | 2006-11-26 20:51:57 +0000 |
commit | 3381a4210cb985e5de9bc114fe58e643934c6c97 (patch) | |
tree | ae1c3b8b0664e623cd740fb6713f02466a1e4719 | |
parent | 930cd3458f42238909e3adfc81e7b3f3489ec905 (diff) | |
download | classpath-3381a4210cb985e5de9bc114fe58e643934c6c97.tar.gz |
Fix for bug #29133.
2006-11-26 Dalibor Topic <robilad@kaffe.org>
Fixes bug #29133.
* libraries/clib/nio/gnu_java_nio_VMSelector.c
(Java_gnu_java_nio_VMSelector_select):
Use strerror if strerror_r is not available.
Reported by: Michael Franz <mvfranz <at> gmail.com>,
Riccardo Mottola <zuse <at> libero.it>
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | native/jni/java-nio/gnu_java_nio_VMSelector.c | 12 |
2 files changed, 20 insertions, 3 deletions
@@ -1,5 +1,16 @@ 2006-11-26 Dalibor Topic <robilad@kaffe.org> + Fixes bug #29133. + + * libraries/clib/nio/gnu_java_nio_VMSelector.c + (Java_gnu_java_nio_VMSelector_select): + Use strerror if strerror_r is not available. + + Reported by: Michael Franz <mvfranz <at> gmail.com>, + Riccardo Mottola <zuse <at> libero.it> + +2006-11-26 Dalibor Topic <robilad@kaffe.org> + Fixes bug #26756. * native/jni/midi-dssi/Makefile.am (AM_CFLAGS): Removed diff --git a/native/jni/java-nio/gnu_java_nio_VMSelector.c b/native/jni/java-nio/gnu_java_nio_VMSelector.c index f8a40aa7a..74a408c75 100644 --- a/native/jni/java-nio/gnu_java_nio_VMSelector.c +++ b/native/jni/java-nio/gnu_java_nio_VMSelector.c @@ -219,7 +219,7 @@ Java_gnu_java_nio_VMSelector_select (JNIEnv * env, fd_set except_fds; struct timeval real_time_data; struct timeval *time_data = NULL; - char message_buf[BUF_SIZE + 1]; + char *message; /* If a legal timeout value isn't given, use NULL. * This means an infinite timeout. The specification @@ -270,7 +270,8 @@ Java_gnu_java_nio_VMSelector_select (JNIEnv * env, if (result < 0) { - +#if defined(HAVE_STRERROR_R) + char message_buf[BUF_SIZE+1]; int errorcode = -result; if (strerror_r (errorcode, message_buf, BUF_SIZE)) @@ -283,7 +284,12 @@ Java_gnu_java_nio_VMSelector_select (JNIEnv * env, return 0; } - JCL_ThrowException (env, "java/io/IOException", message_buf); + message = message_buf; +#else + message = strerror(errno); +#endif + + JCL_ThrowException (env, "java/io/IOException", message); return 0; } |