Merge pull request #30340 from yuwata/repart-error-handling-ftruncate

repart: fix coding style of error handling
This commit is contained in:
Daan De Meyer
2023-12-06 22:02:01 +01:00
committed by GitHub

View 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) {