Currently the database dir is set at startup and stays unmodified even
after the sighup handler has reloaded a configuration which specifies
a different database path.
This patch makes it possible to switch to a different database after
SIGHUP was received. To make this work, we only have invalidate the
database_dir pointer after the database has been closed.
return socket_fd;
}
+static char *database_dir;
+
static void close_afs_tables(void)
{
int i;
PARA_NOTICE_LOG("closing afs_tables\n");
for (i = 0; i < NUM_AFS_TABLES; i++)
afs_tables[i].close();
+ free(database_dir);
+ database_dir = NULL;
}
-static char *database_dir;
-
static void get_database_dir(void)
{
if (!database_dir) {
int i, ret;
close_afs_tables();
+ get_database_dir();
for (i = 0; i < NUM_AFS_TABLES; i++) {
struct afs_table *t = &afs_tables[i];