From: Lennart Poettering Date: Thu, 14 May 2020 07:27:59 +0000 (+0200) Subject: condition: when reading /etc/ modification timestamp, let's actualy compare it as-is X-Git-Tag: v246-rc1~343^2~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b2d1ad757cd7713a492c4d9c1a254d5cbdfc4034;p=thirdparty%2Fsystemd.git condition: when reading /etc/ modification timestamp, let's actualy compare it as-is Previously, we'd only compare the nsec component of it, which sounds needlessly fragile. Let's instead compare the timestamp as it is. --- diff --git a/src/shared/condition.c b/src/shared/condition.c index 4784c7db7de..2d9702d8732 100644 --- a/src/shared/condition.c +++ b/src/shared/condition.c @@ -614,7 +614,7 @@ static int condition_test_needs_update(Condition *c, char **env) { return true; } - timespec_store(&other.st_mtim, timestamp); + return timespec_load_nsec(&usr.st_mtim) > timestamp; } return usr.st_mtim.tv_nsec > other.st_mtim.tv_nsec;