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/05/23 17:21:44 UTC

svn commit: r777942 - /commons/sandbox/runtime/trunk/src/main/native/os/unix/file.c

Author: mturk
Date: Sat May 23 15:21:41 2009
New Revision: 777942

URL: http://svn.apache.org/viewvc?rev=777942&view=rev
Log:
Use real ACR macros for returned error

Modified:
    commons/sandbox/runtime/trunk/src/main/native/os/unix/file.c

Modified: commons/sandbox/runtime/trunk/src/main/native/os/unix/file.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/unix/file.c?rev=777942&r1=777941&r2=777942&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/unix/file.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/unix/file.c Sat May 23 15:21:41 2009
@@ -283,16 +283,15 @@
         if (errno == EACCES)
             ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESECURITY, 0);
         else
-            ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO, errno);
+            ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO,
+                               ACR_GET_OS_ERROR());
     }
     return -1;
 }
 
 ACR_DECLARE(int) ACR_FileProtectionSet(JNIEnv *_E, const char *fname, int prot)
 {
-    struct_stat info;
 
-    /* Always use a real target */
     if (chown(fname, ACR_UnixPermsToMode(prot)) == 0) {
         return 0;
     }
@@ -300,9 +299,10 @@
         if (errno == EACCES)
             ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESECURITY, 0);
         else
-            ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO, errno);
+            ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO,
+                               ACR_GET_OS_ERROR());
     }
-    return errno;
+    return ACR_GET_OS_ERROR();
 }
 
 ACR_IO_EXPORT_DECLARE(int, File, fprot0)(ACR_JNISTDARGS, jstring pathname)