aboutsummaryrefslogtreecommitdiff
path: root/src/common/log.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-11-20 07:08:00 +0000
committerRoger Dingledine <arma@torproject.org>2004-11-20 07:08:00 +0000
commita30a5bce0fab1f5a16f454038666292bbd6c7740 (patch)
tree3a5eeb8a9e2dab365b3ffcc9ade983f89791f8d1 /src/common/log.c
parenta8840db4ac4e3446e5b11a281db2bbae2ab33110 (diff)
downloadtor-a30a5bce0fab1f5a16f454038666292bbd6c7740.tar
tor-a30a5bce0fab1f5a16f454038666292bbd6c7740.tar.gz
simplify close_temp_logs()
(nick, did i break this?) svn:r2913
Diffstat (limited to 'src/common/log.c')
-rw-r--r--src/common/log.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/common/log.c b/src/common/log.c
index 21d967e07..49ad0bd52 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -345,16 +345,16 @@ int add_callback_log(int loglevelMin, int loglevelMax, log_callback cb)
/** 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;
}
}
}