(merge from 3.0)
authorAndrew Bartlett <abartlet@samba.org>
Tue, 6 Jan 2004 01:15:13 +0000 (01:15 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 6 Jan 2004 01:15:13 +0000 (01:15 +0000)
Always call the auto-init funciton - this avoids tdb segfaulting under
us if we failed to open it earlier.

Andrew Bartlett

source/lib/gencache.c

index da8808af1640d2d07d9ba48c3965749bc9d5c606..39e727c24fab0f9ff66184c2dff2dfd84ff28846 100644 (file)
@@ -357,6 +357,9 @@ void gencache_iterate(void (*fn)(const char* key, const char *value, time_t time
 
 int gencache_lock_entry( const char *key )
 {
+       if (!gencache_init())
+               return -1;
+       
        return tdb_lock_bystring(cache, key, 0);
 }
 
@@ -366,6 +369,9 @@ int gencache_lock_entry( const char *key )
 
 void gencache_unlock_entry( const char *key )
 {
+       if (!gencache_init())
+               return;
+       
        tdb_unlock_bystring(cache, key);
        return;
 }