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/02 18:28:17 UTC
svn commit: r770971 - in /commons/sandbox/runtime/trunk/src/main:
java/org/apache/commons/runtime/ java/org/apache/commons/runtime/exception/
native/include/ native/os/darwin/ native/os/hpux/ native/os/linux/
native/os/solaris/ native/os/unix/ native/o...
Author: mturk
Date: Sat May 2 16:28:16 2009
New Revision: 770971
URL: http://svn.apache.org/viewvc?rev=770971&view=rev
Log:
Do not use IOException for OS errors
Modified:
commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Group.java
commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/User.java
commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/exception/ClosedDescriptorException.java
commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/exception/NoSuchObjectException.java
commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/exception/OperatingSystemException.java
commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/exception/UnsupportedOperatingSystemException.java
commons/sandbox/runtime/trunk/src/main/native/include/acr_error.h
commons/sandbox/runtime/trunk/src/main/native/os/darwin/pgroup.c
commons/sandbox/runtime/trunk/src/main/native/os/darwin/puser.c
commons/sandbox/runtime/trunk/src/main/native/os/hpux/pgroup.c
commons/sandbox/runtime/trunk/src/main/native/os/hpux/puser.c
commons/sandbox/runtime/trunk/src/main/native/os/linux/pgroup.c
commons/sandbox/runtime/trunk/src/main/native/os/linux/puser.c
commons/sandbox/runtime/trunk/src/main/native/os/solaris/pgroup.c
commons/sandbox/runtime/trunk/src/main/native/os/solaris/puser.c
commons/sandbox/runtime/trunk/src/main/native/os/unix/group.c
commons/sandbox/runtime/trunk/src/main/native/os/unix/user.c
commons/sandbox/runtime/trunk/src/main/native/os/win32/group.c
commons/sandbox/runtime/trunk/src/main/native/os/win32/user.c
commons/sandbox/runtime/trunk/src/main/native/os/win32/wusec.c
commons/sandbox/runtime/trunk/src/main/native/shared/error.c
Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Group.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Group.java?rev=770971&r1=770970&r2=770971&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Group.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Group.java Sat May 2 16:28:16 2009
@@ -17,8 +17,8 @@
package org.apache.commons.runtime;
import org.apache.commons.runtime.exception.NoSuchObjectException;
+import org.apache.commons.runtime.exception.OperatingSystemException;
-import java.io.IOException;
import java.util.Iterator;
/**
@@ -46,18 +46,18 @@
}
private static native Group get0(String name)
- throws IOException, SecurityException;
+ throws OperatingSystemException, SecurityException;
private static native Group get1()
- throws IOException, SecurityException;
+ throws OperatingSystemException, SecurityException;
private static native Group get2()
- throws IOException, SecurityException;
+ throws OperatingSystemException, SecurityException;
private static native boolean equals0(Descriptor a, Descriptor b);
private static native Group[] enum0()
- throws IOException, SecurityException;
+ throws OperatingSystemException, SecurityException;
private static native Group[] enum1()
- throws IOException, SecurityException, UnsupportedOperationException;
+ throws OperatingSystemException, SecurityException, UnsupportedOperationException;
private static native User[] enum2(Descriptor gid)
- throws IOException, SecurityException;
+ throws OperatingSystemException, SecurityException;
/**
* Create the {@code Group} object from the {@code name}.
@@ -65,11 +65,11 @@
* @return {@code Group} obect.
* @throws SecurityException if access to an internal group database
* is forbidden.
- * @throws IOException in case of I/O error.
+ * @throws OperatingSystemException in case of error.
* @throws NoSuchObjectException if the group {@code name} doesn't exist.
*/
public static Group get(String name)
- throws IOException, SecurityException, NoSuchObjectException
+ throws OperatingSystemException, SecurityException, NoSuchObjectException
{
Group g = get0(name);
if (g == null)
@@ -83,11 +83,11 @@
* @return Current users primary {@code Group} obect.
* @throws SecurityException if access to an internal group database
* is forbidden.
- * @throws IOException in case of I/O error.
+ * @throws OperatingSystemException in case of error.
* @throws NoSuchObjectException if the primary group doesn't exist.
*/
public static Group get()
- throws IOException, SecurityException, NoSuchObjectException
+ throws OperatingSystemException, SecurityException, NoSuchObjectException
{
Group g = get1();
if (g == null)
@@ -101,11 +101,11 @@
* @return Current users effective {@code Group} obect.
* @throws SecurityException if access to an internal group database
* is forbidden.
- * @throws IOException in case of I/O error.
+ * @throws OperatingSystemException in case of error.
* @throws NoSuchObjectException if the effective group doesn't exist.
*/
public static Group getEffective()
- throws IOException, SecurityException, NoSuchObjectException
+ throws OperatingSystemException, SecurityException, NoSuchObjectException
{
Group g = get2();
if (g == null)
@@ -118,12 +118,12 @@
* on this system.
*
* @return GroupIterator containing all {@code local} groups.
- * @throws IOException in case of I/O error.
+ * @throws OperatingSystemException in case of error.
* @throws SecurityException if the current user is not allowed to
* access the system group database.
*/
public static GroupIterator getLocalGroups()
- throws IOException, SecurityException
+ throws OperatingSystemException, SecurityException
{
GroupIterator iter;
synchronized(lock) {
@@ -137,14 +137,14 @@
* on this system.
*
* @return GroupIterator containing all {@code local} groups.
- * @throws IOException in case of I/O error.
+ * @throws OperatingSystemException in case of error.
* @throws SecurityException if the current user is not allowed to
* access the system group database.
* @throws UnsupportedOperationException if the operating system does not
* support the global groups concept.
*/
public static GroupIterator getGlobalGroups()
- throws IOException, SecurityException, UnsupportedOperationException
+ throws OperatingSystemException, SecurityException, UnsupportedOperationException
{
return new GroupIteratorImpl(enum1());
}
@@ -154,12 +154,12 @@
* of {@code this} group.
*
* @return UserIterator containing all user members.
- * @throws IOException in case of I/O error.
+ * @throws OperatingSystemException in case of error.
* @throws SecurityException if the current user is not allowed to
* access the system group database.
*/
public UserIterator getMembers()
- throws IOException, SecurityException
+ throws OperatingSystemException, SecurityException
{
UserIterator iter;
synchronized(lock) {
Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/User.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/User.java?rev=770971&r1=770970&r2=770971&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/User.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/User.java Sat May 2 16:28:16 2009
@@ -17,8 +17,8 @@
package org.apache.commons.runtime;
import org.apache.commons.runtime.exception.NoSuchObjectException;
+import org.apache.commons.runtime.exception.OperatingSystemException;
-import java.io.IOException;
import java.util.Iterator;
/**
@@ -47,16 +47,16 @@
}
private static native User get0(String name)
- throws IOException, SecurityException;
+ throws OperatingSystemException, SecurityException;
private static native User get1()
- throws IOException, SecurityException;
+ throws OperatingSystemException, SecurityException;
private static native User get2()
- throws IOException, SecurityException;
+ throws OperatingSystemException, SecurityException;
private static native boolean equals0(Descriptor a, Descriptor b);
private static native User[] enum0()
- throws IOException, SecurityException;
+ throws OperatingSystemException, SecurityException;
private static native User[] enum1()
- throws IOException, SecurityException;
+ throws OperatingSystemException, SecurityException;
/**
* Create the {@code User} object from the {@code name}.
@@ -64,11 +64,11 @@
* @return {@code User} obect.
* @throws SecurityException if access to an internal user database
* is forbidden.
- * @throws IOException in case of I/O error.
+ * @throws OperatingSystemException in case of error.
* @throws NoSuchObjectException if the user {@code name} doesn't exist.
*/
public static User get(String name)
- throws IOException, SecurityException, NoSuchObjectException
+ throws OperatingSystemException, SecurityException, NoSuchObjectException
{
User u = get0(name);
if (u == null)
@@ -82,11 +82,11 @@
* @return current {@code User} obect.
* @throws SecurityException if access to an internal user database
* is forbidden.
- * @throws IOException in case of I/O error.
+ * @throws OperatingSystemException in case of error.
* @throws NoSuchObjectException if the user {@code name} doesn't exist.
*/
public static User get()
- throws IOException, SecurityException, NoSuchObjectException
+ throws OperatingSystemException, SecurityException, NoSuchObjectException
{
User u = get1();
if (u == null)
@@ -100,11 +100,11 @@
* @return effective {@code User} obect.
* @throws SecurityException if access to an internal user database
* is forbidden.
- * @throws IOException in case of I/O error.
+ * @throws OperatingSystemException in case of error.
* @throws NoSuchObjectException if the user {@code name} doesn't exist.
*/
public static User getEffective()
- throws IOException, SecurityException, NoSuchObjectException
+ throws OperatingSystemException, SecurityException, NoSuchObjectException
{
User u = get2();
if (u == null)
@@ -116,12 +116,12 @@
* Get the {@link UserIterator} of all users defined on the system.
*
* @return UserIterator containing all users.
- * @throws IOException in case of I/O error.
+ * @throws OperatingSystemException in case of error.
* @throws SecurityException if the current user is not allowed to
* access the system user database.
*/
public static UserIterator getUsers()
- throws IOException, SecurityException
+ throws OperatingSystemException, SecurityException
{
UserIterator iter;
synchronized(lock) {
@@ -135,12 +135,12 @@
* logged on to the system.
*
* @return UserIterator containing all logged users.
- * @throws IOException in case of I/O error.
+ * @throws OperatingSystemException in case of error.
* @throws SecurityException if the current user is not allowed to
* access the system user database.
*/
public static UserIterator getLoggedUsers()
- throws IOException, SecurityException
+ throws OperatingSystemException, SecurityException
{
UserIterator iter;
synchronized(lock) {
Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/exception/ClosedDescriptorException.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/exception/ClosedDescriptorException.java?rev=770971&r1=770970&r2=770971&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/exception/ClosedDescriptorException.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/exception/ClosedDescriptorException.java Sat May 2 16:28:16 2009
@@ -24,7 +24,8 @@
* @since Runtime 1.0
*/
-public class ClosedDescriptorException extends IOException {
+public class ClosedDescriptorException extends IOException
+{
public ClosedDescriptorException()
{
Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/exception/NoSuchObjectException.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/exception/NoSuchObjectException.java?rev=770971&r1=770970&r2=770971&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/exception/NoSuchObjectException.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/exception/NoSuchObjectException.java Sat May 2 16:28:16 2009
@@ -24,7 +24,8 @@
* @since Runtime 1.0
*/
-public class NoSuchObjectException extends Exception {
+public class NoSuchObjectException extends RuntimeException
+{
public NoSuchObjectException()
{
Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/exception/OperatingSystemException.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/exception/OperatingSystemException.java?rev=770971&r1=770970&r2=770971&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/exception/OperatingSystemException.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/exception/OperatingSystemException.java Sat May 2 16:28:16 2009
@@ -16,13 +16,15 @@
package org.apache.commons.runtime.exception;
-/** OperatingSystemException
+/**
+ * OperatingSystemException
*
* @author Mladen Turk
*
*/
-public class OperatingSystemException extends Exception {
+public class OperatingSystemException extends RuntimeException
+{
public OperatingSystemException()
{
Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/exception/UnsupportedOperatingSystemException.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/exception/UnsupportedOperatingSystemException.java?rev=770971&r1=770970&r2=770971&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/exception/UnsupportedOperatingSystemException.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/exception/UnsupportedOperatingSystemException.java Sat May 2 16:28:16 2009
@@ -22,7 +22,8 @@
*
*/
-public class UnsupportedOperatingSystemException extends Exception {
+public class UnsupportedOperatingSystemException extends RuntimeException
+{
public UnsupportedOperatingSystemException()
{
Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr_error.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr_error.h?rev=770971&r1=770970&r2=770971&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/acr_error.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/acr_error.h Sat May 2 16:28:16 2009
@@ -51,6 +51,10 @@
ACR_EX_EIO, /* java/io/IOException */
ACR_EX_ESYNC, /* java/io/SyncFailedException */
ACR_EX_ESOCK, /* java/net/SocketException */
+ ACR_EX_CLSOSED_DESC, /* exception/ClosedDescriptorException.java */
+ ACR_EX_ENOENT, /* exception/NoSuchObjectException.java */
+ ACR_EX_OSERR, /* exception/OperatingSystemException.java */
+ ACR_EX_UNSUPPORTED, /* exception/UnsupportedOperatingSystemException.java */
ACR_EX_LEN
} acr_trowclass_e;
Modified: commons/sandbox/runtime/trunk/src/main/native/os/darwin/pgroup.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/darwin/pgroup.c?rev=770971&r1=770970&r2=770971&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/darwin/pgroup.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/darwin/pgroup.c Sat May 2 16:28:16 2009
@@ -46,7 +46,7 @@
if (ACR_STATUS_IS_EACCES(ACR_GET_OS_ERROR()))
ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESECURITY, 0);
else
- ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO,
+ ACR_ThrowException(_E, THROW_NMARK, ACR_EX_OSERR,
ACR_GET_OS_ERROR());
return NULL;
}
Modified: commons/sandbox/runtime/trunk/src/main/native/os/darwin/puser.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/darwin/puser.c?rev=770971&r1=770970&r2=770971&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/darwin/puser.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/darwin/puser.c Sat May 2 16:28:16 2009
@@ -46,7 +46,7 @@
if (ACR_STATUS_IS_EACCES(ACR_GET_OS_ERROR()))
ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESECURITY, 0);
else
- ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO,
+ ACR_ThrowException(_E, THROW_NMARK, ACR_EX_OSERR,
ACR_GET_OS_ERROR());
return NULL;
}
Modified: commons/sandbox/runtime/trunk/src/main/native/os/hpux/pgroup.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/hpux/pgroup.c?rev=770971&r1=770970&r2=770971&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/hpux/pgroup.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/hpux/pgroup.c Sat May 2 16:28:16 2009
@@ -46,7 +46,7 @@
if (ACR_STATUS_IS_EACCES(ACR_GET_OS_ERROR()))
ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESECURITY, 0);
else
- ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO,
+ ACR_ThrowException(_E, THROW_NMARK, ACR_EX_OSERR,
ACR_GET_OS_ERROR());
return NULL;
}
Modified: commons/sandbox/runtime/trunk/src/main/native/os/hpux/puser.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/hpux/puser.c?rev=770971&r1=770970&r2=770971&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/hpux/puser.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/hpux/puser.c Sat May 2 16:28:16 2009
@@ -46,7 +46,7 @@
if (ACR_STATUS_IS_EACCES(ACR_GET_OS_ERROR()))
ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESECURITY, 0);
else
- ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO,
+ ACR_ThrowException(_E, THROW_NMARK, ACR_EX_OSERR,
ACR_GET_OS_ERROR());
return NULL;
}
Modified: commons/sandbox/runtime/trunk/src/main/native/os/linux/pgroup.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/linux/pgroup.c?rev=770971&r1=770970&r2=770971&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/linux/pgroup.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/linux/pgroup.c Sat May 2 16:28:16 2009
@@ -48,7 +48,7 @@
if (ACR_STATUS_IS_EACCES(ACR_FROM_OS_ERROR(rc)))
ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESECURITY, 0);
else
- ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO,
+ ACR_ThrowException(_E, THROW_NMARK, ACR_EX_OSERR,
ACR_FROM_OS_ERROR(rc));
return NULL;
}
Modified: commons/sandbox/runtime/trunk/src/main/native/os/linux/puser.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/linux/puser.c?rev=770971&r1=770970&r2=770971&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/linux/puser.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/linux/puser.c Sat May 2 16:28:16 2009
@@ -48,7 +48,7 @@
if (ACR_STATUS_IS_EACCES(ACR_FROM_OS_ERROR(rc)))
ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESECURITY, 0);
else
- ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO,
+ ACR_ThrowException(_E, THROW_NMARK, ACR_EX_OSERR,
ACR_FROM_OS_ERROR(rc));
return NULL;
}
Modified: commons/sandbox/runtime/trunk/src/main/native/os/solaris/pgroup.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/solaris/pgroup.c?rev=770971&r1=770970&r2=770971&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/solaris/pgroup.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/solaris/pgroup.c Sat May 2 16:28:16 2009
@@ -48,7 +48,7 @@
if (ACR_STATUS_IS_EACCES(ACR_GET_OS_ERROR()))
ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESECURITY, 0);
else
- ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO,
+ ACR_ThrowException(_E, THROW_NMARK, ACR_EX_OSERR,
ACR_GET_OS_ERROR());
return NULL;
}
Modified: commons/sandbox/runtime/trunk/src/main/native/os/solaris/puser.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/solaris/puser.c?rev=770971&r1=770970&r2=770971&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/solaris/puser.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/solaris/puser.c Sat May 2 16:28:16 2009
@@ -48,7 +48,7 @@
if (ACR_STATUS_IS_EACCES(ACR_GET_OS_ERROR()))
ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESECURITY, 0);
else
- ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO,
+ ACR_ThrowException(_E, THROW_NMARK, ACR_EX_OSERR,
ACR_GET_OS_ERROR());
return NULL;
}
Modified: commons/sandbox/runtime/trunk/src/main/native/os/unix/group.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/unix/group.c?rev=770971&r1=770970&r2=770971&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/unix/group.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/unix/group.c Sat May 2 16:28:16 2009
@@ -109,7 +109,7 @@
else if (ACR_STATUS_IS_EACCES(ACR_FROM_OS_ERROR(rc)))
ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESECURITY, 0);
else
- ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO,
+ ACR_ThrowException(_E, THROW_NMARK, ACR_EX_OSERR,
ACR_FROM_OS_ERROR(rc));
}
if (!gr)
@@ -153,7 +153,7 @@
else if (ACR_STATUS_IS_EACCES(ACR_FROM_OS_ERROR(rc)))
ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESECURITY, 0);
else
- ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO,
+ ACR_ThrowException(_E, THROW_NMARK, ACR_EX_OSERR,
ACR_FROM_OS_ERROR(rc));
}
if (!gr)
@@ -260,7 +260,7 @@
else if (ACR_STATUS_IS_EACCES(ACR_FROM_OS_ERROR(rc)))
ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESECURITY, 0);
else
- ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO,
+ ACR_ThrowException(_E, THROW_NMARK, ACR_EX_OSERR,
ACR_FROM_OS_ERROR(rc));
}
if (!gr || !gr->gr_mem)
Modified: commons/sandbox/runtime/trunk/src/main/native/os/unix/user.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/unix/user.c?rev=770971&r1=770970&r2=770971&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/unix/user.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/unix/user.c Sat May 2 16:28:16 2009
@@ -124,7 +124,7 @@
else if (ACR_STATUS_IS_EACCES(ACR_FROM_OS_ERROR(rc)))
ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESECURITY, 0);
else
- ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO,
+ ACR_ThrowException(_E, THROW_NMARK, ACR_EX_OSERR,
ACR_FROM_OS_ERROR(rc));
return NULL;
}
@@ -174,7 +174,7 @@
else if (ACR_STATUS_IS_EACCES(ACR_FROM_OS_ERROR(rc)))
ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESECURITY, 0);
else
- ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO,
+ ACR_ThrowException(_E, THROW_NMARK, ACR_EX_OSERR,
ACR_FROM_OS_ERROR(rc));
return NULL;
}
@@ -274,7 +274,7 @@
if (ACR_STATUS_IS_EACCES(ACR_GET_OS_ERROR()))
ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESECURITY, 0);
else
- ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO,
+ ACR_ThrowException(_E, THROW_NMARK, ACR_EX_OSERR,
ACR_GET_OS_ERROR());
return NULL;
}
Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/group.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/group.c?rev=770971&r1=770970&r2=770971&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/group.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/group.c Sat May 2 16:28:16 2009
@@ -122,7 +122,7 @@
if (ACR_STATUS_IS_EACCES(err))
ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESECURITY, 0);
else if (ACR_TO_OS_ERROR(err) != ERROR_NONE_MAPPED)
- ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO, err);
+ ACR_ThrowException(_E, THROW_NMARK, ACR_EX_OSERR, err);
return NULL;
}
@@ -182,13 +182,13 @@
if (!(sid = ACR_Malloc(_E, THROW_FMARK, len)))
return NULL;
if (!CopySid(len, sid, id)) {
- ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO, ACR_GET_OS_ERROR());
+ ACR_ThrowException(_E, THROW_NMARK, ACR_EX_OSERR, ACR_GET_OS_ERROR());
free(sid);
return NULL;
}
sidtype = ACR_GetAccountNameFromSid(name, MAX_PATH, sid);
if (sidtype == -1) {
- ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO, ACR_GET_OS_ERROR());
+ ACR_ThrowException(_E, THROW_NMARK, ACR_EX_OSERR, ACR_GET_OS_ERROR());
free(sid);
return NULL;
}
@@ -223,7 +223,7 @@
}
else {
ACR_DescriptorCleanup(_E, gid);
- ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO,
+ ACR_ThrowException(_E, THROW_NMARK, ACR_EX_OSERR,
ACR_FROM_OS_ERROR(rc));
return NULL;
}
Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/user.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/user.c?rev=770971&r1=770970&r2=770971&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/user.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/user.c Sat May 2 16:28:16 2009
@@ -136,7 +136,7 @@
if (ACR_STATUS_IS_EACCES(err))
ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESECURITY, 0);
else if (ACR_TO_OS_ERROR(err) != ERROR_NONE_MAPPED)
- ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO, err);
+ ACR_ThrowException(_E, THROW_NMARK, ACR_EX_OSERR, err);
/* TODO: Throw exception */
return NULL;
@@ -181,7 +181,7 @@
}
else {
ACR_DescriptorCleanup(_E, uid);
- ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO,
+ ACR_ThrowException(_E, THROW_NMARK, ACR_EX_OSERR,
ACR_FROM_OS_ERROR(rc));
return NULL;
}
@@ -210,13 +210,13 @@
if (!(sid = ACR_Malloc(_E, THROW_FMARK, len)))
return NULL;
if (!CopySid(len, sid, id)) {
- ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO, ACR_GET_OS_ERROR());
+ ACR_ThrowException(_E, THROW_NMARK, ACR_EX_OSERR, ACR_GET_OS_ERROR());
free(sid);
return NULL;
}
sidtype = ACR_GetAccountNameFromSid(name, MAX_PATH, sid);
if (sidtype == -1) {
- ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO, ACR_GET_OS_ERROR());
+ ACR_ThrowException(_E, THROW_NMARK, ACR_EX_OSERR, ACR_GET_OS_ERROR());
free(sid);
return NULL;
}
@@ -259,7 +259,7 @@
}
else {
ACR_DescriptorCleanup(_E, uid);
- ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO,
+ ACR_ThrowException(_E, THROW_NMARK, ACR_EX_OSERR,
ACR_FROM_OS_ERROR(rc));
return NULL;
}
Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/wusec.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/wusec.c?rev=770971&r1=770970&r2=770971&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/wusec.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/wusec.c Sat May 2 16:28:16 2009
@@ -98,7 +98,7 @@
if (ACR_STATUS_IS_EACCES(ACR_FROM_OS_ERROR(rc)))
ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESECURITY, 0);
else if (rc != NERR_UserNotFound && rc != NERR_GroupNotFound)
- ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO,
+ ACR_ThrowException(_E, THROW_NMARK, ACR_EX_OSERR,
ACR_FROM_OS_ERROR(rc));
}
return NULL;
@@ -108,7 +108,7 @@
}
if (!GetTokenInformation(h, ic, rv, sz, &sz)) {
if(_E) {
- ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO,
+ ACR_ThrowException(_E, THROW_NMARK, ACR_EX_OSERR,
ACR_GET_OS_ERROR());
}
free(rv);
@@ -172,7 +172,7 @@
if (ACR_STATUS_IS_EACCES(ACR_FROM_OS_ERROR(rc)))
ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESECURITY, 0);
else
- ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO,
+ ACR_ThrowException(_E, THROW_NMARK, ACR_EX_OSERR,
ACR_FROM_OS_ERROR(rc));
}
return NULL;
@@ -195,7 +195,7 @@
if (ACR_STATUS_IS_EACCES(ec))
ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESECURITY, 0);
else
- ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO, ec);
+ ACR_ThrowException(_E, THROW_NMARK, ACR_EX_OSERR, ec);
}
}
}
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=770971&r1=770970&r2=770971&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/error.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/error.c Sat May 2 16:28:16 2009
@@ -37,6 +37,10 @@
"java/io/IOException",
"java/io/SyncFailedException",
"java/net/SocketException",
+ ACR_CLASS_PATH "exception/ClosedDescriptorException.java",
+ ACR_CLASS_PATH "exception/NoSuchObjectException.java",
+ ACR_CLASS_PATH "exception/OperatingSystemException.java",
+ ACR_CLASS_PATH "exception/UnsupportedOperatingSystemException.java",
NULL
};