c = NULL;
if (!closed) {
+ /* close the name cache so that close_our_files() doesn't steal its FD */
+ namecache_shutdown();
+
/* redirect stdout & stderr since we can't know that
the library functions we use are using DEBUG. */
if ( (fd = open("/dev/null", O_WRONLY)) < 0)
BOOL gencache_shutdown(void)
{
+ int ret;
/* tdb_close routine returns -1 on error */
if (!cache) return False;
DEBUG(5, ("Closing cache file\n"));
- return tdb_close(cache) != -1;
+ ret = tdb_close(cache);
+ cache = NULL;
+ return ret != -1;
}