summaryrefslogtreecommitdiff
path: root/src/journal
diff options
context:
space:
mode:
authorJan Alexander Steffens (heftig) <jan.steffens@gmail.com>2013-03-20 21:32:05 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-03-21 23:24:38 -0400
commit6c142648aaced56ab681fcc97a71b06d588122a9 (patch)
tree93fabe583d280c5add35daa64ea72b0d716657b6 /src/journal
parent72536eb73674883f0c8522a241ecd86c032665db (diff)
Fix vacuum logic error
The vacuum code used to stop vacuuming after one deletion, even when max_use was still exceeded. Also make usage a uint64_t, as the code already pretends it is one. Signed-off-by: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
Diffstat (limited to 'src/journal')
-rw-r--r--src/journal/journal-vacuum.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/journal/journal-vacuum.c b/src/journal/journal-vacuum.c
index 731f6c770f..4a3a5a9e63 100644
--- a/src/journal/journal-vacuum.c
+++ b/src/journal/journal-vacuum.c
@@ -36,7 +36,7 @@
#include "util.h"
struct vacuum_info {
- off_t usage;
+ uint64_t usage;
char *filename;
uint64_t realtime;
@@ -293,7 +293,7 @@ int journal_directory_vacuum(
if (unlinkat(dirfd(d), list[i].filename, 0) >= 0) {
log_debug("Deleted archived journal %s/%s.", directory, list[i].filename);
- if ((uint64_t) list[i].usage > sum)
+ if (list[i].usage < sum)
sum -= list[i].usage;
else
sum = 0;