]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
repart: fix coding style of error handling 30340/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 6 Dec 2023 02:34:11 +0000 (11:34 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 6 Dec 2023 02:35:10 +0000 (11:35 +0900)
Follow-up for c4a87b76c3e5f74f62d4431b85e7c5f71add3916.

src/partition/repart.c

index 654b931c1920bc2d6d0b2b2f139bb765101edfb9..a6582d71c022171c8d7442d054ac61ff2c679867 100644 (file)
@@ -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) {