Skip to content
Snippets Groups Projects
Commit 605e10a6 authored by Nick Mathewson's avatar Nick Mathewson :game_die:
Browse files

Stop multiplying logs on sighup.

svn:r1936
parent 69931106
No related branches found
No related tags found
No related merge requests found
...@@ -205,6 +205,13 @@ void close_temp_logs(void) ...@@ -205,6 +205,13 @@ void close_temp_logs(void)
} }
} }
void mark_logs_temp(void)
{
logfile_t *lf;
for (lf = logfiles; lf; lf = lf->next)
lf->is_temporary = 1;
}
/** /**
* Add a log handler to send messages to <b>filename</b>. If opening * Add a log handler to send messages to <b>filename</b>. If opening
* the logfile fails, -1 is returned and errno is set appropriately * the logfile fails, -1 is returned and errno is set appropriately
......
...@@ -54,6 +54,7 @@ void close_logs(); ...@@ -54,6 +54,7 @@ void close_logs();
void reset_logs(); void reset_logs();
void add_temp_log(void); void add_temp_log(void);
void close_temp_logs(void); void close_temp_logs(void);
void mark_logs_temp(void);
/* Outputs a message to stdout */ /* Outputs a message to stdout */
void _log(int severity, const char *format, ...) CHECK_PRINTF(2,3); void _log(int severity, const char *format, ...) CHECK_PRINTF(2,3);
......
...@@ -608,6 +608,7 @@ static int do_hup(void) { ...@@ -608,6 +608,7 @@ static int do_hup(void) {
log_fn(LOG_NOTICE,"Received sighup. Reloading config."); log_fn(LOG_NOTICE,"Received sighup. Reloading config.");
has_completed_circuit=0; has_completed_circuit=0;
mark_logs_temp(); /* Close current logs once new logs are open. */
/* first, reload config variables, in case they've changed */ /* first, reload config variables, in case they've changed */
/* no need to provide argc/v, they've been cached inside init_from_config */ /* no need to provide argc/v, they've been cached inside init_from_config */
if (init_from_config(0, NULL) < 0) { if (init_from_config(0, NULL) < 0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment