[or-cvs] Remove some functions that were around for hupping log file...

arma at seul.org arma at seul.org
Wed Nov 30 06:45:33 UTC 2005


Update of /home2/or/cvsroot/tor/src/common
In directory moria:/home/arma/work/onion/cvs/tor/src/common

Modified Files:
	log.c 
Log Message:
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().


Index: log.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/common/log.c,v
retrieving revision 1.108
retrieving revision 1.109
diff -u -d -r1.108 -r1.109
--- log.c	30 Nov 2005 06:38:41 -0000	1.108
+++ log.c	30 Nov 2005 06:45:30 -0000	1.109
@@ -67,9 +67,6 @@
 
 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
  * <b>buf_len</b> character buffer in <b>buf</b>.
@@ -326,26 +323,6 @@
   }
 }
 
-#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 <b>victim</b> 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 @@
   }
 }
 
-#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 <b>loglevel</b>
  * or higher to <b>stream</b>. */
 void



More information about the tor-commits mailing list