From: Lennart Poettering Date: Thu, 25 Oct 2018 10:30:36 +0000 (+0200) Subject: journald: use usec_sub_unsigned() where we can X-Git-Tag: v240~467^2~12 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6761e0a2fd48e06b8e6f25e0434babb9639615b1;p=thirdparty%2Fsystemd.git journald: use usec_sub_unsigned() where we can --- diff --git a/src/journal/journal-vacuum.c b/src/journal/journal-vacuum.c index 840fb69ee02..e756bf452b3 100644 --- a/src/journal/journal-vacuum.c +++ b/src/journal/journal-vacuum.c @@ -15,6 +15,7 @@ #include "journal-vacuum.h" #include "parse-util.h" #include "string-util.h" +#include "time-util.h" #include "util.h" #include "xattr-util.h" @@ -140,13 +141,8 @@ int journal_directory_vacuum( if (max_use <= 0 && max_retention_usec <= 0 && n_max_files <= 0) return 0; - if (max_retention_usec > 0) { - retention_limit = now(CLOCK_REALTIME); - if (retention_limit > max_retention_usec) - retention_limit -= max_retention_usec; - else - max_retention_usec = retention_limit = 0; - } + if (max_retention_usec > 0) + retention_limit = usec_sub_unsigned(now(CLOCK_REALTIME), max_retention_usec); d = opendir(directory); if (!d)