]> git.sur5r.net Git - openldap/blob - servers/slapd/back-bdb/error.c
Notices
[openldap] / servers / slapd / back-bdb / error.c
1 /* error.c - BDB errcall routine */
2 /* $OpenLDAP$ */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
4  *
5  * Copyright 2000-2003 The OpenLDAP Foundation.
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted only as authorized by the OpenLDAP
10  * Public License.
11  *
12  * A copy of this license is available in the file LICENSE in the
13  * top-level directory of the distribution or, alternatively, at
14  * <http://www.OpenLDAP.org/license.html>.
15  */
16
17 #include "portable.h"
18
19 #include <stdio.h>
20 #include <ac/string.h>
21
22 #include "slap.h"
23 #include "back-bdb.h"
24
25 void bdb_errcall( const char *pfx, char * msg )
26 {
27 #ifdef HAVE_EBCDIC
28         if ( msg[0] > 0x7f )
29                 __etoa( msg );
30 #endif
31 #ifdef NEW_LOGGING
32         LDAP_LOG ( OPERATION, INFO, "bdb(%s): %s\n", pfx, msg, 0 );
33 #else
34         Debug( LDAP_DEBUG_ANY, "bdb(%s): %s\n", pfx, msg, 0 );
35 #endif
36 }
37
38 #ifdef HAVE_EBCDIC
39
40 #undef db_strerror
41
42 /* Not re-entrant! */
43 char *ebcdic_dberror( int rc )
44 {
45         static char msg[1024];
46
47         strcpy( msg, db_strerror( rc ) );
48         __etoa( msg );
49         return msg;
50 }
51 #endif