From c96ab5c880012b1ced437a99945af90371c25673 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Wed, 18 Aug 2004 15:32:36 +0000 Subject: [PATCH] map ERROR_FILE_NOT_FOUND to SigarFileNotFoundException on win32 --- bindings/java/src/jni/javasigar.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/bindings/java/src/jni/javasigar.c b/bindings/java/src/jni/javasigar.c index 1db10a44..f22500e7 100644 --- a/bindings/java/src/jni/javasigar.c +++ b/bindings/java/src/jni/javasigar.c @@ -71,18 +71,21 @@ static void sigar_throw_notimpl(JNIEnv *env, char *msg) JENV->ThrowNew(env, errorClass, msg); } +#ifdef WIN32 +# define SIGAR_ENOENT ERROR_FILE_NOT_FOUND +#else +# define SIGAR_ENOENT ENOENT +#endif + static void sigar_throw_error(JNIEnv *env, jni_sigar_t *jsigar, int err) { jclass errorClass; switch (err) { -#ifndef WIN32 - case ENOENT: + case SIGAR_ENOENT: errorClass = SIGAR_FIND_CLASS("SigarFileNotFoundException"); break; -#else - /*XXX*/ -#endif + case SIGAR_ENOTIMPL: if (jsigar->not_impl == NULL) { jfieldID id;