]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
condition: when reading /etc/ modification timestamp, let's actualy compare it as-is
authorLennart Poettering <lennart@poettering.net>
Thu, 14 May 2020 07:27:59 +0000 (09:27 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 18 May 2020 18:17:57 +0000 (20:17 +0200)
Previously, we'd only compare the nsec component of it, which sounds
needlessly fragile. Let's instead compare the timestamp as it is.

src/shared/condition.c

index 4784c7db7de7cbc288e631c407aacf40e3a602a5..2d9702d87320617c335920d84d72a1ce08b6b9c9 100644 (file)
@@ -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;