]> git.sur5r.net Git - openldap/blob - servers/slapd/back-bdb/error.c
Sync with HEAD
[openldap] / servers / slapd / back-bdb / error.c
1 /* error.c - BDB errcall routine */
2 /* $OpenLDAP$ */
3 /*
4  * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
5  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
6  */
7
8 #include "portable.h"
9
10 #include <stdio.h>
11 #include <ac/string.h>
12
13 #include "slap.h"
14 #include "back-bdb.h"
15
16 void bdb_errcall( const char *pfx, char * msg )
17 {
18 #ifdef HAVE_EBCDIC
19         if ( msg[0] > 0x7f )
20                 __etoa( msg );
21 #endif
22 #ifdef NEW_LOGGING
23         LDAP_LOG ( OPERATION, INFO, "bdb(%s): %s\n", pfx, msg, 0 );
24 #else
25         Debug( LDAP_DEBUG_ANY, "bdb(%s): %s\n", pfx, msg, 0 );
26 #endif
27 }
28
29 #ifdef HAVE_EBCDIC
30
31 #undef db_strerror
32
33 /* Not re-entrant! */
34 char *ebcdic_dberror( int rc )
35 {
36         static char msg[1024];
37
38         strcpy( msg, db_strerror( rc ) );
39         __etoa( msg );
40         return msg;
41 }
42 #endif