[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] yes, in fact, i broke it. putting back.



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

Modified Files:
	log.c 
Log Message:
yes, in fact, i broke it. putting back.


Index: log.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/common/log.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -d -r1.72 -r1.73
--- log.c	20 Nov 2004 07:33:53 -0000	1.72
+++ log.c	20 Nov 2004 12:16:47 -0000	1.73
@@ -345,16 +345,16 @@
 /** Close any log handlers added by add_temp_log or marked by mark_logs_temp */
 void close_temp_logs(void)
 {
-  logfile_t *victim, *lf;
-  for (lf = logfiles; lf; ) {
-    if (lf->is_temporary) {
-      victim = lf;
-      lf = lf->next;
-      close_log(victim);
-      tor_free(victim->filename);
-      tor_free(victim);
+  logfile_t *lf, **p;
+  for (p = &logfiles; *p; ) {
+    if ((*p)->is_temporary) {
+      lf = *p;
+      *p = (*p)->next;
+      close_log(lf);
+      tor_free(lf->filename);
+      tor_free(lf);
     } else {
-      lf = lf->next;
+      p = &((*p)->next);
     }
   }
 }