Rework DB_THREAD test

This commit is contained in:
Kurt Zeilenga 2001-06-07 17:23:43 +00:00
parent af79d6e354
commit 5d1608ac1b
2 changed files with 20 additions and 20 deletions

View File

@ -354,15 +354,21 @@ main()
#ifdef DB_CDB_ALLDB #ifdef DB_CDB_ALLDB
rc = env->set_flags( env, DB_CDB_ALLDB, 1 ); rc = env->set_flags( env, DB_CDB_ALLDB, 1 );
if( rc == 0 )
if( rc ) {
printf("BerkeleyDB: %s\n", db_strerror(rc) );
return rc;
}
#endif #endif
{
#if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1) #if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
rc = env->open( env, NULL, flags, 0 ); rc = env->open( env, NULL, flags, 0 );
#else #else
rc = env->open( env, NULL, NULL, flags, 0 ); rc = env->open( env, NULL, NULL, flags, 0 );
#endif #endif
if ( rc == 0 ) {
rc = env->close( env, 0 );
} }
if( rc ) { if( rc ) {
@ -370,12 +376,6 @@ main()
return rc; return rc;
} }
#if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
env->remove( env, NULL, DB_FORCE );
#else
env->remove( env, NULL, NULL, DB_FORCE );
#endif
#else #else
DB_ENV env; DB_ENV env;
memset( &env, '\0', sizeof(env) ); memset( &env, '\0', sizeof(env) );

20
configure vendored
View File

@ -12921,15 +12921,21 @@ main()
#ifdef DB_CDB_ALLDB #ifdef DB_CDB_ALLDB
rc = env->set_flags( env, DB_CDB_ALLDB, 1 ); rc = env->set_flags( env, DB_CDB_ALLDB, 1 );
if( rc == 0 )
if( rc ) {
printf("BerkeleyDB: %s\n", db_strerror(rc) );
return rc;
}
#endif #endif
{
#if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1) #if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
rc = env->open( env, NULL, flags, 0 ); rc = env->open( env, NULL, flags, 0 );
#else #else
rc = env->open( env, NULL, NULL, flags, 0 ); rc = env->open( env, NULL, NULL, flags, 0 );
#endif #endif
if ( rc == 0 ) {
rc = env->close( env, 0 );
} }
if( rc ) { if( rc ) {
@ -12937,12 +12943,6 @@ main()
return rc; return rc;
} }
#if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
env->remove( env, NULL, DB_FORCE );
#else
env->remove( env, NULL, NULL, DB_FORCE );
#endif
#else #else
DB_ENV env; DB_ENV env;
memset( &env, '\0', sizeof(env) ); memset( &env, '\0', sizeof(env) );