mirror of
https://github.com/ckolivas/lrzip.git
synced 2026-01-20 15:20:15 +01:00
Forgot two instances of temporary outfiles that need to be unlinked.
This commit is contained in:
parent
68469c2b6f
commit
8a4df9774f
5
main.c
5
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 */
|
||||
|
|
|
|||
Loading…
Reference in a new issue