From 6b3e6d299d5298a5936dbba57f67cdfc4a406789 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Thu, 16 Apr 2020 05:13:50 +0200 Subject: tar2sqfs & gensquashfs: Delete the output file on failure This commit changes the tar2sqfs & gensquashfs code to pass the exit status on to sqfs_writer_cleanup in libcommon. The function sqfs writer code in libcommon is changed to retain the output file name and delete it if the status passed to the cleanup function is anything other than EXIT_SUCCESS. Signed-off-by: David Oberhollenzer --- tar/tar2sqfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tar/tar2sqfs.c') diff --git a/tar/tar2sqfs.c b/tar/tar2sqfs.c index 6186930..1ebe642 100644 --- a/tar/tar2sqfs.c +++ b/tar/tar2sqfs.c @@ -539,6 +539,6 @@ int main(int argc, char **argv) status = EXIT_SUCCESS; out: - sqfs_writer_cleanup(&sqfs); + sqfs_writer_cleanup(&sqfs, status); return status; } -- cgit v1.2.3