X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=afs.c;h=d9cddeb87b356103164bee70ddf2534122c7923a;hp=bad8b8dcf94a2078e764720f415790a64a260680;hb=ac1f19d550a81c8408c8fce2e237996c950253ab;hpb=b8ecd28c263ff39366a47fe9f7a5785bd43e89ab diff --git a/afs.c b/afs.c index bad8b8dc..d9cddeb8 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" @@ -589,8 +589,9 @@ static int com_select_callback(struct afs_callback_arg *aca) para_printf(&aca->pbout, "activating dummy mood\n"); activate_mood_or_playlist(NULL, &num_admissible, NULL); out: - para_printf(&aca->pbout, "activated %s (%d admissible files)\n", - current_mop? current_mop : "dummy mood", num_admissible); + para_printf(&aca->pbout, "activated %s (%d admissible file%s)\n", + current_mop? current_mop : "dummy mood", num_admissible, + num_admissible == 1? "" : "s"); free_lpr: lls_free_parse_result(aca->lpr, cmd); return ret; @@ -638,16 +639,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 +688,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) @@ -1022,6 +1024,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];