[kaffe] CVS kaffe (robilad): Fixlet for build on darwin6

Kaffe CVS cvs-commits at kaffe.org
Thu Mar 31 17:07:28 PST 2005


PatchSet 5632 
Date: 2005/04/01 01:02:55
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Fixlet for build on darwin6

2005-04-01  Dalibor Topic  <robilad at kaffe.org>

* 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>

Members: 
	ChangeLog:1.3803->1.3804 
	libraries/clib/nio/gnu_java_nio_VMSelector.c:1.4->1.5 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3803 kaffe/ChangeLog:1.3804
--- kaffe/ChangeLog:1.3803	Thu Mar 31 23:36:48 2005
+++ kaffe/ChangeLog	Fri Apr  1 01:02:55 2005
@@ -1,3 +1,11 @@
+2005-04-01  Dalibor Topic  <robilad at kaffe.org>
+
+	* 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>
+
 2005-03-31  Dalibor Topic  <robilad at kaffe.org>
 
 	* TODO: Removed completed tasks.
Index: kaffe/libraries/clib/nio/gnu_java_nio_VMSelector.c
diff -u kaffe/libraries/clib/nio/gnu_java_nio_VMSelector.c:1.4 kaffe/libraries/clib/nio/gnu_java_nio_VMSelector.c:1.5
--- kaffe/libraries/clib/nio/gnu_java_nio_VMSelector.c:1.4	Tue Mar 29 17:58:55 2005
+++ kaffe/libraries/clib/nio/gnu_java_nio_VMSelector.c	Fri Apr  1 01:02:56 2005
@@ -220,8 +220,8 @@
 	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
 	 * also says that a zero timeout should be treated
@@ -267,6 +267,9 @@
 	
 	if (result < 0)
     {
+#if defined(HAVE_STRERROR_R)
+	char message_buf[BUF_SIZE+1];
+
     	if( strerror_r(errno, message_buf, BUF_SIZE) )
     	{
     		/* This would mean that message_buf was to small
@@ -276,9 +279,13 @@
     			"Not enough space in message buffer.");
     		return 0;
     	}
-    	
-		JCL_ThrowException (env, "java/io/IOException", message_buf);
-		return 0;
+	message = message_buf;
+#else
+	message = strerror(errno);
+#endif
+
+	JCL_ThrowException (env, "java/io/IOException", message);
+	return 0;
     }
 
 	/* Set the file descriptors according to the values returned from select(). */




More information about the kaffe mailing list