]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-bdb/error.c
Converted ch_malloc, ch_calloc and ch_realloc calls to SLAP_MALLOC,
[openldap] / servers / slapd / back-bdb / error.c
index aced7cf0dacf787b14ec54bbe6be56efcd9d4645..79d528a0e0272b53aaab46b5902defd5a097718a 100644 (file)
@@ -1,14 +1,13 @@
-/* error.c - BDB errcall routine  */
+/* error.c - BDB errcall routine */
 /* $OpenLDAP$ */
 /*
- * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
  */
 
 #include "portable.h"
 
 #include <stdio.h>
-
 #include <ac/string.h>
 
 #include "slap.h"
 
 void bdb_errcall( const char *pfx, char * msg )
 {
-       Debug( LDAP_DEBUG_ANY, "bdb(%s): %s", pfx, msg, 0 );
+#ifdef HAVE_EBCDIC
+       if ( msg[0] > 0x7f )
+               __etoa( msg );
+#endif
+#ifdef NEW_LOGGING
+       LDAP_LOG ( OPERATION, INFO, "bdb(%s): %s\n", pfx, msg, 0 );
+#else
+       Debug( LDAP_DEBUG_ANY, "bdb(%s): %s\n", pfx, msg, 0 );
+#endif
+}
+
+#ifdef HAVE_EBCDIC
+
+#undef db_strerror
+
+/* Not re-entrant! */
+char *ebcdic_dberror( int rc )
+{
+       static char msg[1024];
+
+       strcpy( msg, db_strerror( rc ) );
+       __etoa( msg );
+       return msg;
 }
+#endif