[or-cvs] simplify close_temp_logs()
Roger Dingledine
arma at seul.org
Sat Nov 20 07:08:02 UTC 2004
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:
simplify close_temp_logs()
(nick, did i break this?)
Index: log.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/common/log.c,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -d -r1.70 -r1.71
--- log.c 20 Nov 2004 06:52:13 -0000 1.70
+++ log.c 20 Nov 2004 07:08:00 -0000 1.71
@@ -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 *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);
+ 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);
} else {
- p = &((*p)->next);
+ lf = lf->next;
}
}
}
More information about the tor-commits
mailing list