openldap/servers/slapd/back-bdb/error.c

43 lines
747 B
C
Raw Normal View History

2001-11-26 22:41:03 -05:00
/* error.c - BDB errcall routine */
2000-09-18 21:59:08 -04:00
/* $OpenLDAP$ */
/*
2002-01-04 16:17:25 -05:00
* Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
2000-09-18 21:59:08 -04:00
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
#include "portable.h"
#include <stdio.h>
#include <ac/string.h>
#include "slap.h"
#include "back-bdb.h"
void bdb_errcall( const char *pfx, char * msg )
{
2002-08-22 00:39:59 -04:00
#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
2000-10-01 15:21:07 -04:00
Debug( LDAP_DEBUG_ANY, "bdb(%s): %s\n", pfx, msg, 0 );
#endif
2000-09-18 21:59:08 -04:00
}
2002-08-22 00:39:59 -04:00
#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