From 8a4df9774f6467166dd210e2bce2709731587469 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Mon, 7 Mar 2011 13:44:29 +1100 Subject: [PATCH] Forgot two instances of temporary outfiles that need to be unlinked. --- main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 84c958a..158ccaa 100644 --- a/main.c +++ b/main.c @@ -363,7 +363,7 @@ static void decompress_file(void) fatal("Failed to open history file %s\n", control.outfile); /* Unlink temporary file as soon as possible */ - if (unlikely(STDOUT && unlink(control.outfile))) + if (unlikely((STDOUT || TEST_ONLY) && unlink(control.outfile))) fatal("Failed to unlink tmpfile: %s\n", control.outfile); if (NO_MD5) @@ -681,6 +681,9 @@ static void compress_file(void) fd_out = open_tmpoutfile(); control.fd_out = fd_out; + if (unlikely(STDOUT && unlink(control.outfile))) + fatal("Failed to unlink tmpfile: %s\n", control.outfile); + preserve_perms(fd_in, fd_out); /* write zeroes to 24 bytes at beginning of file */