]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
update-done: create /etc and /var if they didn't exist 36803/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 19 Mar 2025 16:06:44 +0000 (17:06 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 20 Mar 2025 14:57:14 +0000 (15:57 +0100)
Previously, we would fail. But this doesn't seem useful: we may want to
mark the update as done even if /etc/ or /var/ no updates were necessary
and there was no need to create /etc/ or /var/ yet.

src/update-done/update-done.c

index b30bb2dbf0b1968268c452a217ccf81f898aeb99..62c12c5d214ab3a77c8036eb843c83db53bd981b 100644 (file)
@@ -32,7 +32,7 @@ static int save_timestamp(const char *dir, struct timespec *ts) {
 
         fd = chase_and_open(dir, arg_root,
                             CHASE_PREFIX_ROOT | CHASE_WARN | CHASE_MUST_BE_DIRECTORY,
-                            O_DIRECTORY | O_CLOEXEC,
+                            O_DIRECTORY | O_CLOEXEC | O_CREAT,
                             &dirpath);
         if (fd < 0)
                 return log_error_errno(fd, "Failed to open %s%s: %m", strempty(arg_root), dir);