From 4cf7a108e885530c063bebd1c65ff1c9b41e45b0 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Tue, 7 Mar 2006 15:43:05 +0000 Subject: [PATCH] Fix archive file expiration. --- WHATS_NEW | 1 + lib/format_text/archive.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index 53279ce04..7afe5d61e 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.03 - =================================== + Fix archive file expiration. Fix dmeventd build. Version 2.02.02 - 7th February 2006 diff --git a/lib/format_text/archive.c b/lib/format_text/archive.c index dcdbdef04..a13f1af45 100644 --- a/lib/format_text/archive.c +++ b/lib/format_text/archive.c @@ -207,8 +207,8 @@ static void _remove_expired(struct list *archives, uint32_t archives_size, /* Convert retain_days into the time after which we must retain */ retain_time = time(NULL) - (time_t) retain_days *SECS_PER_DAY; - /* Assume list is ordered oldest first (by index) */ - list_iterate_items(bf, archives) { + /* Assume list is ordered newest first (by index) */ + list_iterate_back_items(bf, archives) { /* Get the mtime of the file and unlink if too old */ if (stat(bf->path, &sb)) { log_sys_error("stat", bf->path);