update-done: Do not fail with read-only /etc or /var

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.
This commit is contained in:
Felix Riemann 2020-10-19 18:54:53 +02:00 committed by Yu Watanabe
parent 4b28e50f9e
commit 1eee15c388
1 changed files with 2 additions and 2 deletions

View 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;
}