From: Lennart Poettering Date: Fri, 8 Jul 2022 08:05:39 +0000 (+0200) Subject: tmpfiles: shorten code a bit X-Git-Tag: v252-rc1~702 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f3745dd2652d1aec57d945291a2e67a3304d559;p=thirdparty%2Fsystemd.git tmpfiles: shorten code a bit --- 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);