From 77a425d8b2b2f4b62e09aaf64679b8c8731f88c2 Mon Sep 17 00:00:00 2001 From: Roger Dingledine Date: Wed, 30 Nov 2005 06:45:30 +0000 Subject: [PATCH] Remove some functions that were around for hupping log files. We handle them already in do_hup() by marking our log files as temporary and then rotating them in options_init_from_torrc(). svn:r5473 --- src/common/log.c | 43 ------------------------------------------- 1 file changed, 43 deletions(-) diff --git a/src/common/log.c b/src/common/log.c index 93fd854f4e..b452519642 100644 --- a/src/common/log.c +++ b/src/common/log.c @@ -67,9 +67,6 @@ static int syslog_count = 0; static void delete_log(logfile_t *victim); static void close_log(logfile_t *victim); -#if 0 -static int reset_log(logfile_t *lf); -#endif /** Helper: Write the standard prefix for log lines to a * buf_len character buffer in buf. @@ -326,26 +323,6 @@ close_logs(void) } } -#if 0 -/** Close and re-open all log files; used to rotate logs on SIGHUP. */ -/* Nobody uses this. Remove it? XXXX */ -void -reset_logs(void) -{ - logfile_t *lf = logfiles; - while (lf) { - if (reset_log(lf)) { - /* error. don't log it. delete the log entry and continue. */ - logfile_t *victim = lf; - lf = victim->next; - delete_log(victim); - continue; - } - lf = lf->next; - } -} -#endif - /** Remove and free the log entry victim from the linked-list * logfiles (it must be present in the list when this function is * called). After this function is called, the caller shouldn't refer @@ -384,26 +361,6 @@ close_log(logfile_t *victim) } } -#if 0 -/** Helper: reset a single logfile_t. For a file log, this involves - * closing and reopening the log, and maybe writing the version. For - * other log types, do nothing. */ -static int -reset_log(logfile_t *lf) -{ - if (lf->needs_close) { - if (fclose(lf->file)==EOF || - !(lf->file = fopen(lf->filename, "a"))) { - return -1; - } else { - if (log_tor_version(lf, 1) < 0) - return -1; - } - } - return 0; -} -#endif - /** Add a log handler to send all messages of severity loglevel * or higher to stream. */ void