Hi all,
I've checked in the patch below to fix the build on darwin5, where
strerror_r does not exist,
apparently.
2006-11-26 Dalibor Topic <[EMAIL PROTECTED]>
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>
cheers,
dalibor topic
Index: native/jni/java-nio/gnu_java_nio_VMSelector.c
===================================================================
RCS file: /sources/classpath/classpath/native/jni/java-nio/gnu_java_nio_VMSelector.c,v
retrieving revision 1.11
diff -u -r1.11 gnu_java_nio_VMSelector.c
--- native/jni/java-nio/gnu_java_nio_VMSelector.c 25 Jan 2006 10:40:12 -0000 1.11
+++ native/jni/java-nio/gnu_java_nio_VMSelector.c 26 Nov 2006 20:43:02 -0000
@@ -219,7 +219,7 @@
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 @@
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 @@
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;
}