]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Merge pull request #30340 from yuwata/repart-error-handling-ftruncate
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 6 Dec 2023 21:02:01 +0000 (22:02 +0100)
committerGitHub <noreply@github.com>
Wed, 6 Dec 2023 21:02:01 +0000 (22:02 +0100)
repart: fix coding style of error handling

src/partition/repart.c

index 473c83a6ac5021e8aa61d3e1050ef72f29e40ed0..41eb1d771afcbd5d2c58daa724d32db4dd17c8c7 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) {