]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
efivars: drop unneeded UTIME_NOW
authorMike Yuan <me@yhndnzj.com>
Mon, 29 Apr 2024 07:45:14 +0000 (15:45 +0800)
committerMike Yuan <me@yhndnzj.com>
Mon, 29 Apr 2024 08:33:17 +0000 (16:33 +0800)
futimens(2) defaults to current time if 'times' is NULL.

src/basic/efivars.c

index 43f498de0ff7e34108f82e55d703eafa1a309f19..8470d085c77f6aa59305fd330264f8ab4c14ae77 100644 (file)
@@ -239,10 +239,7 @@ int efi_set_variable(const char *variable, const void *value, size_t size) {
 
         /* For some reason efivarfs doesn't update mtime automatically. Let's do it manually then. This is
          * useful for processes that cache EFI variables to detect when changes occurred. */
-        if (futimens(fd, (const struct timespec[2]) {
-                                { .tv_nsec = UTIME_NOW },
-                                { .tv_nsec = UTIME_NOW }
-                         }) < 0)
+        if (futimens(fd, /* times = */ NULL) < 0)
                 log_debug_errno(errno, "Failed to update mtime/atime on %s, ignoring: %m", p);
 
         r = 0;