classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] native/jni/java-nio/gnu_java_nio_VMSelector.c strerror ifde


From: Christian Thalinger
Subject: [cp-patches] native/jni/java-nio/gnu_java_nio_VMSelector.c strerror ifdef's
Date: Fri, 13 May 2005 14:19:08 +0200

Check which strerror we have or even if we have any.

Index: native/jni/java-nio/gnu_java_nio_VMSelector.c
===================================================================
RCS
file: 
/ahome/cacao/cacaocvs/cacao/src/classpath/native/jni/java-nio/gnu_java_nio_VMSelector.c,v
retrieving revision 1.3
diff -u -3 -p -r1.3 gnu_java_nio_VMSelector.c
--- native/jni/java-nio/gnu_java_nio_VMSelector.c       4 May 2005
10:09:47 -0000       1.3
+++ native/jni/java-nio/gnu_java_nio_VMSelector.c       13 May 2005
12:11:38 -0000
@@ -219,7 +219,6 @@ Java_gnu_java_nio_VMSelector_select (JNI
   fd_set except_fds;
   struct timeval real_time_data;
   struct timeval *time_data = NULL;
-  char message_buf[BUF_SIZE + 1];
 
   /* If a legal timeout value isn't given, use NULL.
    * This means an infinite timeout. The specification
@@ -270,9 +269,12 @@ Java_gnu_java_nio_VMSelector_select (JNI
 
   if (result < 0)
     {
-
+#if defined(HAVE_STRERROR_R) || defined(HAVE_STRERROR)
       int errorcode = -result;
 
+#if defined(HAVE_STRERROR_R)
+      char message_buf[BUF_SIZE + 1];
+
       if (strerror_r (errorcode, message_buf, BUF_SIZE))
        {
          /* This would mean that message_buf was to small
@@ -284,6 +286,12 @@ Java_gnu_java_nio_VMSelector_select (JNI
        }
 
       JCL_ThrowException (env, "java/io/IOException", message_buf);
+#else
+      JCL_ThrowException (env, "java/io/IOException", strerror
(errorcode));
+#endif
+#else /* defined(HAVE_STRERROR_R) || defined(HAVE_STRERROR) */
+      JCL_ThrowException (env, "java/io/IOException", "no strerror
available");
+#endif
       return 0;
     }
 






reply via email to

[Prev in Thread] Current Thread [Next in Thread]