From 2f3745dd2652d1aec57d945291a2e67a3304d559 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 8 Jul 2022 10:05:39 +0200 Subject: [PATCH] tmpfiles: shorten code a bit --- src/tmpfiles/tmpfiles.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index 6c64f57d27b..a0c9ff8df6d 100644 --- a/src/tmpfiles/tmpfiles.c +++ b/src/tmpfiles/tmpfiles.c @@ -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); -- 2.47.3