statcache initialisation fix
authorAndrew Tridgell <tridge@samba.org>
Sat, 12 May 2001 13:04:15 +0000 (13:04 +0000)
committerAndrew Tridgell <tridge@samba.org>
Sat, 12 May 2001 13:04:15 +0000 (13:04 +0000)
pointed out by Elrond

source/smbd/statcache.c

index 8200c277b322f974d383cbd7c3e902014e93c7c0..65a4830016436ff548231fc263b9d42cc609ac4d 100644 (file)
@@ -221,11 +221,11 @@ BOOL reset_stat_cache( void )
        static BOOL initialised;
        if (!lp_stat_cache()) return True;
 
-       if (!initialised) {
-               initialised = True;
-               return hash_table_init( &stat_cache, INIT_STAT_CACHE_SIZE, (compare_function)(strcmp));
+       if (initialised) {
+               hash_clear(&stat_cache);
        }
-       hash_clear(&stat_cache);
-       return hash_table_init( &stat_cache, INIT_STAT_CACHE_SIZE, (compare_function)(strcmp));
 
+       initialised = hash_table_init( &stat_cache, INIT_STAT_CACHE_SIZE, 
+                                      (compare_function)(strcmp));
+       return initialised;
 } /* reset_stat_cache  */