Skip to content

Commit

Permalink
mkcompose: report close() errors
Browse files Browse the repository at this point in the history
if the out_file is specified, make sure it is explicitly close()d and
that possible errors are reported instead of being ignored.

Signed-off-by: Giuseppe Scrivano <[email protected]>
  • Loading branch information
giuseppe committed Jul 30, 2024
1 parent 2d2c09d commit 76b4da5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tools/mkcomposefs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1606,6 +1606,9 @@ int main(int argc, char **argv)
printf("%s\n", digest_str);
}

if (out_file && fclose(out_file) == EOF)
err(EXIT_FAILURE, "close output file");

lcfs_node_unref(root);
return 0;
}
Expand Down

0 comments on commit 76b4da5

Please sign in to comment.