if ( data.dptr ) {
free( data.dptr );
memset( &data, 0, sizeof( Datum ));
+ data.dptr = NULL;
}
}
#elif defined( HAVE_GDBM )
+#ifdef HAVE_ST_BLKSIZE
#include <sys/stat.h>
+#endif
/*****************************************************************
* *
ldbm_open( char *name, int rw, int mode, int dbcachesize )
{
LDBM db;
- struct stat st;
LDBM_LOCK;
LDBM_UNLOCK;
return( NULL );
}
+
+#ifdef HAVE_ST_BLKSIZE
if ( dbcachesize > 0 && stat( name, &st ) == 0 ) {
+ struct stat st;
dbcachesize = (dbcachesize / st.st_blksize);
gdbm_setopt( db, GDBM_CACHESIZE, &dbcachesize, sizeof(int) );
}
+#else
+ dbcachesize = (dbcachesize / 4096);
+ gdbm_setopt( db, GDBM_CACHESIZE, &dbcachesize, sizeof(int) );
+#endif
LDBM_UNLOCK;