tmpfiles: shorten code a bit

This commit is contained in:
Lennart Poettering 2022-07-08 10:05:39 +02:00
parent 18f2638f48
commit 2f3745dd26

View file

@ -1515,10 +1515,8 @@ static int truncate_file(Item *i, const char *path) {
log_debug("Writing to \"%s\".", path);
r = loop_write(fd, i->argument, strlen(i->argument), false);
if (r < 0) {
r = erofs ? -EROFS : r;
return log_error_errno(r, "Failed to write file %s: %m", path);
}
if (r < 0)
return log_error_errno(erofs ? -EROFS : r, "Failed to write file %s: %m", path);
}
return fd_set_perms(i, fd, path, st);