{
#ifdef DB_VERSION_MAJOR /* DB version >= 2 */
int Major, Minor, Patch ;
+ unsigned long Version ;
(void)db_version(&Major, &Minor, &Patch) ;
printf("You have Berkeley DB Version 2 or greater\n");
}
printf("db.h and libdb are compatible\n") ;
- /* needs to be >= 2.05 */
- if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) {
- printf("but Perl needs Berkeley DB 2.0.5 or greater\n") ;
+
+ Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
+ + DB_VERSION_PATCH ;
+
+ /* needs to be >= 2.3.4 */
+ if (Version < 2003004) {
+ /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH
+< 5) { */
+ printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
exit(2);
}
DBT_flags(key) ;
DBT_flags(value) ;
RETVAL = do_SEQ(db, key, value, R_LAST) ;
- if (RETVAL < 0 && errno == EBADF)
- {
- recno_t oops = -1;
- key.data = &oops;
- key.size = sizeof(oops);
- db_get(db, key, value, 0);
- RETVAL = do_SEQ(db, key, value, R_LAST) ;
- }
if (RETVAL == 0)
RETVAL = *(I32 *)key.data ;
else /* No key means empty file */