]> git.sur5r.net Git - openldap/blob - servers/slapd/back-bdb/error.c
cbb457929a0eee08b9f29b3664185572aee67217
[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-2004 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         Debug( LDAP_DEBUG_ANY, "bdb(%s): %s\n", pfx, msg, 0 );
32 }
33
34 #ifdef HAVE_EBCDIC
35
36 #undef db_strerror
37
38 /* Not re-entrant! */
39 char *ebcdic_dberror( int rc )
40 {
41         static char msg[1024];
42
43         strcpy( msg, db_strerror( rc ) );
44         __etoa( msg );
45         return msg;
46 }
47 #endif