From ad85def2fb590dd635f54bfead3281f8cc8b7439 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Wed, 18 Aug 2004 15:46:34 +0000 Subject: [PATCH] map EACCES/ERROR_ACCESS_DENIED to SigarPermissionDeniedException --- bindings/java/src/jni/javasigar.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bindings/java/src/jni/javasigar.c b/bindings/java/src/jni/javasigar.c index f22500e7..6bd2ca70 100644 --- a/bindings/java/src/jni/javasigar.c +++ b/bindings/java/src/jni/javasigar.c @@ -77,6 +77,12 @@ static void sigar_throw_notimpl(JNIEnv *env, char *msg) # define SIGAR_ENOENT ENOENT #endif +#ifdef WIN32 +# define SIGAR_EACCES ERROR_ACCESS_DENIED +#else +# define SIGAR_EACCES EACCES +#endif + static void sigar_throw_error(JNIEnv *env, jni_sigar_t *jsigar, int err) { jclass errorClass; @@ -86,6 +92,10 @@ static void sigar_throw_error(JNIEnv *env, jni_sigar_t *jsigar, int err) errorClass = SIGAR_FIND_CLASS("SigarFileNotFoundException"); break; + case SIGAR_EACCES: + errorClass = SIGAR_FIND_CLASS("SigarPermissionDeniedException"); + break; + case SIGAR_ENOTIMPL: if (jsigar->not_impl == NULL) { jfieldID id;