From: Yu Watanabe Date: Wed, 6 Dec 2023 02:34:11 +0000 (+0900) Subject: repart: fix coding style of error handling X-Git-Tag: v256-rc1~1592^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F30340%2Fhead;p=thirdparty%2Fsystemd.git repart: fix coding style of error handling Follow-up for c4a87b76c3e5f74f62d4431b85e7c5f71add3916. --- diff --git a/src/partition/repart.c b/src/partition/repart.c index 654b931c192..a6582d71c02 100644 --- a/src/partition/repart.c +++ b/src/partition/repart.c @@ -6264,10 +6264,10 @@ static int context_minimize(Context *context) { d = loop_device_unref(d); /* Erase the previous filesystem first. */ - if (ftruncate(fd, 0)) + if (ftruncate(fd, 0) < 0) return log_error_errno(errno, "Failed to erase temporary file: %m"); - if (ftruncate(fd, fsz)) + if (ftruncate(fd, fsz) < 0) return log_error_errno(errno, "Failed to truncate temporary file to %s: %m", FORMAT_BYTES(fsz)); if (arg_offline <= 0) {