java-errno-header-20090526
[openafs.git] / src / JAVA / libjafs / Internal.c
index c43bcb4..d44ab32 100644 (file)
  */
 
 #include "Internal.h"
+#include <errno.h>
 
 #ifdef DMALLOC
 #include "dmalloc.h"
 #endif
 
-extern int errno;
-
 #ifndef LIBJUAFS
 // user class and fields //
 jclass userCls = 0;
@@ -173,23 +172,20 @@ void throwException
   if( *excCls == 0 ) {
     *excCls = (*env)->NewGlobalRef(env, (*env)->FindClass(env, excClsName ));
     if( !*excCls ) {
-      fprintf(stderr, "ERROR: Internal::throwException()\n
-                       Cannot find class: %s\n", excClsName);
+      fprintf(stderr, "ERROR: Internal::throwException()\n Cannot find class: %s\n", excClsName);
        return;
     }
     *initID = (*env)->GetMethodID( env, *excCls, "<init>", "(I)V" );
     if( !*initID ) {
-      fprintf(stderr, "ERROR: Internal::throwException()\n
-                       Cannot find construction method: %s\n",
-                       excClsName);
+      fprintf(stderr, "ERROR: Internal::throwException()\n Cannot find construction method: %s\n",
+             excClsName);
        return;
     }
   }
   
   exc = (*env)->NewObject( env, *excCls, *initID, code );
   if( !exc ) {
-    fprintf(stderr, "ERROR: Internal::throwException()\n
-                     Cannot construct new exception object: %s\n",
+    fprintf(stderr, "ERROR: Internal::throwException()\n Cannot construct new exception object: %s\n",
                      excClsName);
     return;
   }
@@ -206,8 +202,7 @@ void throwMessageException( JNIEnv *env, char *msg )
 {
   jclass excCls = (*env)->FindClass(env, afsExceptionName);
   if(excCls == 0) {
-    fprintf(stderr, "ERROR: Internal::throwMessageException()\n
-                     Cannot find class: %s\n", afsExceptionName);
+    fprintf(stderr, "ERROR: Internal::throwMessageException()\n Cannot find class: %s\n", afsExceptionName);
     return;
   }
   (*env)->ThrowNew(env, excCls, msg);
@@ -226,16 +221,14 @@ void throwAFSException( JNIEnv *env, int code )
 
   afsExceptionCls = (*env)->FindClass(env, afsExceptionName);
   if( !afsExceptionCls ) {
-    fprintf(stderr, "ERROR: Internal::throwAFSException()\n
-                     Cannot find class: %s\n", afsExceptionName);
+    fprintf(stderr, "ERROR: Internal::throwAFSException()\n Cannot find class: %s\n", afsExceptionName);
     return;
   }
 
   afsExceptionInit = (*env)->GetMethodID( env, afsExceptionCls, 
                              "<init>", "(I)V" );
   if( !afsExceptionInit ) {
-    fprintf(stderr, "ERROR: Internal::throwAFSException()\n
-                     Cannot find construction method: %s\n",
+    fprintf(stderr, "ERROR: Internal::throwAFSException()\n Cannot find construction method: %s\n",
                      afsExceptionName);
     return;
   }
@@ -243,8 +236,7 @@ void throwAFSException( JNIEnv *env, int code )
   exc = (*env)->NewObject( env, afsExceptionCls, afsExceptionInit, code );
 
   if( !exc ) {
-    fprintf(stderr, "ERROR: Internal::throwAFSException()\n
-                     Cannot construct new exception object: %s\n",
+    fprintf(stderr, "ERROR: Internal::throwAFSException()\n Cannot construct new exception object: %s\n",
                      afsExceptionName);
     return;
   }
@@ -264,16 +256,14 @@ void throwAFSFileException( JNIEnv *env, int code, char *msg )
 
   afsFileExceptionCls = (*env)->FindClass(env, afsFileExceptionName);
   if( !afsFileExceptionCls ) {
-    fprintf(stderr, "ERROR: Internal::throwAFSFileException()\n
-                     Cannot find class: %s\n", afsFileExceptionName);
+    fprintf(stderr, "ERROR: Internal::throwAFSFileException()\n Cannot find class: %s\n", afsFileExceptionName);
     return;
   }
 
   afsFileExceptionInit = (*env)->GetMethodID( env, afsFileExceptionCls, 
                          "<init>", "(Ljava/lang/String;I)V" );
   if( !afsFileExceptionInit ) {
-    fprintf(stderr, "ERROR: Internal::throwAFSFileException()\n
-                     Cannot find construction method: %s\n",
+    fprintf(stderr, "ERROR: Internal::throwAFSFileException()\n Cannot find construction method: %s\n",
                      afsFileExceptionName);
     return;
   }
@@ -281,8 +271,7 @@ void throwAFSFileException( JNIEnv *env, int code, char *msg )
   exc = (*env)->NewObject( env, afsFileExceptionCls,
                            afsFileExceptionInit, msg, code );
   if( !exc ) {
-    fprintf(stderr, "ERROR: Internal::throwAFSFileException()\n
-                     Cannot construct new exception object: %s\n",
+    fprintf(stderr, "ERROR: Internal::throwAFSFileException()\n Cannot construct new exception object: %s\n",
                      afsFileExceptionName);
     return;
   }
@@ -302,16 +291,14 @@ void throwAFSSecurityException( JNIEnv *env, int code )
 
   afsSecurityExceptionCls = (*env)->FindClass(env, afsSecurityExceptionName);
   if( !afsSecurityExceptionCls ) {
-    fprintf(stderr, "ERROR: Internal::throwAFSSecurityException()\n
-                     Cannot find class: %s\n", afsSecurityExceptionName);
+    fprintf(stderr, "ERROR: Internal::throwAFSSecurityException()\n Cannot find class: %s\n", afsSecurityExceptionName);
     return;
   }
 
   afsSecurityExceptionInit = (*env)->GetMethodID( env, afsSecurityExceptionCls, 
                              "<init>", "(I)V" );
   if( !afsSecurityExceptionInit ) {
-    fprintf(stderr, "ERROR: Internal::throwAFSSecurityException()\n
-                     Cannot find construction method: %s\n",
+    fprintf(stderr, "ERROR: Internal::throwAFSSecurityException()\n Cannot find construction method: %s\n",
                      afsSecurityExceptionName);
     return;
   }
@@ -319,8 +306,7 @@ void throwAFSSecurityException( JNIEnv *env, int code )
   exc = (*env)->NewObject( env, afsSecurityExceptionCls,
                            afsSecurityExceptionInit, code );
   if( !exc ) {
-    fprintf(stderr, "ERROR: Internal::throwAFSSecurityException()\n
-                     Cannot construct new exception object: %s\n",
+    fprintf(stderr, "ERROR: Internal::throwAFSSecurityException()\n Cannot construct new exception object: %s\n",
                      afsSecurityExceptionName);
     return;
   }