diff --git a/src/dird/dird.c b/src/dird/dird.c index 86ad6710186..baef525f097 100644 --- a/src/dird/dird.c +++ b/src/dird/dird.c @@ -42,7 +42,7 @@ int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result); #endif /* Forward referenced subroutines */ -void terminate_dird(int sig); +static void terminate_dird(int sig); static bool check_resources(); static bool initialize_sql_pooling(void); static void cleanup_old_files(); @@ -66,6 +66,7 @@ void init_device_resources(); static char *runjob = NULL; static bool background = true; +static bool test_config = false; static void init_reload(void); /* Globals Exported */ @@ -155,7 +156,6 @@ int main (int argc, char *argv[]) JCR *jcr; cat_op mode; bool no_signals = false; - bool test_config = false; bool export_config_schema = false; char *uid = NULL; char *gid = NULL; @@ -405,8 +405,10 @@ void terminate_dird(int sig) db_sql_pool_destroy(); db_flush_backends(); unload_dir_plugins(); - write_state_file(me->working_directory, "bareos-dir", get_first_port_host_order(me->DIRaddrs)); - delete_pid_file(me->pid_directory, "bareos-dir", get_first_port_host_order(me->DIRaddrs)); + if (!test_config) { /* we don't need to do this block in test mode */ + write_state_file(me->working_directory, "bareos-dir", get_first_port_host_order(me->DIRaddrs)); + delete_pid_file(me->pid_directory, "bareos-dir", get_first_port_host_order(me->DIRaddrs)); + } term_scheduler(); term_job_server(); diff --git a/src/stored/stored.c b/src/stored/stored.c index 4ad1789f7ec..d79b3c3ec74 100644 --- a/src/stored/stored.c +++ b/src/stored/stored.c @@ -39,7 +39,7 @@ extern bool parse_sd_config(CONFIG *config, const char *configfile, int exit_code); /* Forward referenced functions */ -void terminate_stored(int sig); +static void terminate_stored(int sig); static int check_resources(); static void cleanup_old_files(); @@ -667,7 +667,7 @@ void *device_initialization(void *arg) /* * Clean up and then exit */ -void terminate_stored(int sig) +static void terminate_stored(int sig) { static bool in_here = false; DEVRES *device;