]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
update-done: Do not fail with read-only /etc or /var
authorFelix Riemann <felix.riemann@sma.de>
Mon, 19 Oct 2020 16:54:53 +0000 (18:54 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 20 Oct 2020 04:46:36 +0000 (13:46 +0900)
With the switch from log_debug() to log_debug_errno() in commit c413bb28df
systemd-update-done would fail without any error message if /etc
or /var were read-only. This restores the previous behaviour to
silently ignore these directories again.

src/update-done/update-done.c

index e9d589e0e53045eaae06b213b39f1b0ce21c182c..92c348d83bc8003c25867c92fdb04a660dc75f99 100644 (file)
@@ -31,8 +31,8 @@ static int apply_timestamp(const char *path, struct timespec *ts) {
 
         r = write_string_file_atomic_label_ts(path, message, ts);
         if (r == -EROFS)
-                return log_debug_errno(r, "Cannot create \"%s\", file system is read-only.", path);
-        if (r < 0)
+                log_debug_errno(r, "Cannot create \"%s\", file system is read-only.", path);
+        else if (r < 0)
                 return log_error_errno(r, "Failed to write \"%s\": %m", path);
         return 0;
 }