2001-11-27 11:41:03 +08:00
|
|
|
/* error.c - BDB errcall routine */
|
2000-09-19 09:59:08 +08:00
|
|
|
/* $OpenLDAP$ */
|
2003-11-29 05:08:20 +08:00
|
|
|
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
|
|
|
|
*
|
2013-01-03 02:20:30 +08:00
|
|
|
* Copyright 2000-2013 The OpenLDAP Foundation.
|
2003-11-29 05:08:20 +08:00
|
|
|
* 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
|
|
|
|
* <http://www.OpenLDAP.org/license.html>.
|
2000-09-19 09:59:08 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "portable.h"
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <ac/string.h>
|
|
|
|
|
|
|
|
#include "slap.h"
|
|
|
|
#include "back-bdb.h"
|
|
|
|
|
2004-10-17 06:10:32 +08:00
|
|
|
#if DB_VERSION_FULL < 0x04030000
|
2000-09-19 09:59:08 +08:00
|
|
|
void bdb_errcall( const char *pfx, char * msg )
|
2004-10-17 06:10:32 +08:00
|
|
|
#else
|
2004-11-13 21:22:48 +08:00
|
|
|
void bdb_errcall( const DB_ENV *env, const char *pfx, const char * msg )
|
2004-10-17 06:10:32 +08:00
|
|
|
#endif
|
2000-09-19 09:59:08 +08:00
|
|
|
{
|
2002-08-22 12:39:59 +08:00
|
|
|
#ifdef HAVE_EBCDIC
|
|
|
|
if ( msg[0] > 0x7f )
|
|
|
|
__etoa( msg );
|
|
|
|
#endif
|
2000-10-02 03:21:07 +08:00
|
|
|
Debug( LDAP_DEBUG_ANY, "bdb(%s): %s\n", pfx, msg, 0 );
|
2000-09-19 09:59:08 +08:00
|
|
|
}
|
2002-08-22 12:39:59 +08:00
|
|
|
|
2005-04-16 09:24:00 +08:00
|
|
|
#if DB_VERSION_FULL >= 0x04030000
|
|
|
|
void bdb_msgcall( const DB_ENV *env, const char *msg )
|
|
|
|
{
|
|
|
|
#ifdef HAVE_EBCDIC
|
|
|
|
if ( msg[0] > 0x7f )
|
|
|
|
__etoa( msg );
|
|
|
|
#endif
|
|
|
|
Debug( LDAP_DEBUG_TRACE, "bdb: %s\n", msg, 0, 0 );
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2002-08-22 12:39:59 +08: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
|