X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fback-bdb%2Ferror.c;h=4b58c834c2cc9c21e318abf68ede21b8aa993ee8;hb=47c6701a2293fec249cdb84f69b37addfb4b36fc;hp=aced7cf0dacf787b14ec54bbe6be56efcd9d4645;hpb=aaab54e14270a6ba1d6d16f9b0b9bcf52a7c8cba;p=openldap diff --git a/servers/slapd/back-bdb/error.c b/servers/slapd/back-bdb/error.c index aced7cf0da..4b58c834c2 100644 --- a/servers/slapd/back-bdb/error.c +++ b/servers/slapd/back-bdb/error.c @@ -1,14 +1,22 @@ -/* error.c - BDB errcall routine */ +/* error.c - BDB errcall routine */ /* $OpenLDAP$ */ -/* - * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved. - * COPYING RESTRICTIONS APPLY, see COPYRIGHT file +/* This work is part of OpenLDAP Software . + * + * Copyright 2000-2004 The OpenLDAP Foundation. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted only as authorized by the OpenLDAP + * Public License. + * + * A copy of this license is available in the file LICENSE in the + * top-level directory of the distribution or, alternatively, at + * . */ #include "portable.h" #include - #include #include "slap.h" @@ -16,5 +24,28 @@ 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