You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2009/09/17 12:34:29 UTC

svn commit: r816132 - in /commons/sandbox/runtime/trunk/src/main: java/org/apache/commons/runtime/io/Status.java native/shared/error.c

Author: mturk
Date: Thu Sep 17 10:34:29 2009
New Revision: 816132

URL: http://svn.apache.org/viewvc?rev=816132&view=rev
Log:
Get error code description from native

Modified:
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/Status.java
    commons/sandbox/runtime/trunk/src/main/native/shared/error.c

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/Status.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/Status.java?rev=816132&r1=816131&r2=816132&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/Status.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/Status.java Thu Sep 17 10:34:29 2009
@@ -429,5 +429,6 @@
         return is0(EEXIST, s);
     }
 
+    public static native String describe(int s);
     /* TODO: Implement the remaining of STATUS_IS methods */
 }

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/error.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/error.c?rev=816132&r1=816131&r2=816132&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/error.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/error.c Thu Sep 17 10:34:29 2009
@@ -903,3 +903,9 @@
     }
     return is ? JNI_TRUE : JNI_FALSE;
 }
+
+ACR_JNI_EXPORT_DECLARE(jstring, io_Status, describe)(ACR_JNISTDARGS, jint err)
+{
+    char buf[512];
+    return ACR_NewJavaStringA(_E, acr_os_strerror(buf, sizeof(buf), err));
+}