Fix up some locking

This commit is contained in:
Kurt Zeilenga 2001-06-07 16:24:46 +00:00
parent d773c7178f
commit e8ac75d22f

View file

@ -275,6 +275,8 @@ ldbm_open( char *name, int rw, int mode, int dbcachesize )
err = db_create( &ret, ldbm_Env, 0 );
if ( err != 0 ) {
(void)ret->close(ret, 0);
LDBM_UNLOCK;
return NULL;
}
@ -283,13 +285,17 @@ ldbm_open( char *name, int rw, int mode, int dbcachesize )
err = ret->open( ret, name, NULL, DB_TYPE, rw, mode);
LDBM_UNLOCK;
if ( err != 0 ) {
int tmp = errno;
(void)ret->close(ret, 0);
errno = tmp;
LDBM_UNLOCK;
return NULL;
}
LDBM_UNLOCK;
#elif DB_VERSION_MAJOR >= 2
DB_INFO dbinfo;
@ -336,7 +342,7 @@ ldbm_open( char *name, int rw, int mode, int dbcachesize )
LDBM_UNLOCK;
#endif
return( ret );
return ret;
}
void