X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=afs.c;h=4fe2140be607effea9d5c0a17c1eec8f41011b59;hp=d9aa3ce05ddd4e3135b2097c149f0eaf493a4d57;hb=0b8b2469b5d2b81ff928bddd10d4ac3b819b75f8;hpb=42c6dc96316660fe476a6baadd87a2c79da07c83 diff --git a/afs.c b/afs.c index d9aa3ce0..4fe2140b 100644 --- a/afs.c +++ b/afs.c @@ -22,8 +22,8 @@ #include "string.h" #include "afh.h" #include "afs.h" -#include "server.h" #include "net.h" +#include "server.h" #include "ipc.h" #include "list.h" #include "sched.h" @@ -638,16 +638,18 @@ static int setup_command_socket_or_die(void) 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) { @@ -685,8 +687,7 @@ static int open_afs_tables(void) ret = afs_tables[i].open(database_dir); if (ret >= 0) continue; - PARA_ERROR_LOG("%s open: %s\n", afs_tables[i].name, - para_strerror(-ret)); + PARA_ERROR_LOG("could not open %s\n", afs_tables[i].name); break; } if (ret >= 0) @@ -1007,6 +1008,10 @@ __noreturn void afs_init(int socket_fd) out_close: close_afs_tables(); out: + signal_shutdown(signal_task); + free_status_items(); + free(current_mop); + free_lpr(); if (ret < 0) PARA_EMERG_LOG("%s\n", para_strerror(-ret)); exit(EXIT_FAILURE); @@ -1018,6 +1023,7 @@ static int com_init_callback(struct afs_callback_arg *aca) int i, ret; close_afs_tables(); + get_database_dir(); for (i = 0; i < NUM_AFS_TABLES; i++) { struct afs_table *t = &afs_tables[i];