mirror of
https://github.com/ckolivas/lrzip.git
synced 2025-12-06 07:12:00 +01:00
Preserve times on compression
This commit is contained in:
parent
5a5c5cd425
commit
64afd02a7d
11
lrzip.c
11
lrzip.c
|
|
@ -1246,6 +1246,11 @@ bool compress_file(rzip_control *control)
|
|||
if (ENCRYPT)
|
||||
release_hashes(control);
|
||||
|
||||
if (unlikely(!STDIN && !STDOUT && !preserve_times(control, fd_in))) {
|
||||
fatal("Failed to preserve times on output file\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (unlikely(close(fd_in))) {
|
||||
fatal("Failed to close fd_in\n");
|
||||
fd_in = -1;
|
||||
|
|
@ -1264,8 +1269,10 @@ bool compress_file(rzip_control *control)
|
|||
free(control->outfile);
|
||||
return true;
|
||||
error:
|
||||
if (STDIN && (fd_in > 0)) close(fd_in);
|
||||
if ((!STDOUT) && (fd_out > 0)) close(fd_out);
|
||||
if (STDIN && (fd_in > 0))
|
||||
close(fd_in);
|
||||
if ((!STDOUT) && (fd_out > 0))
|
||||
close(fd_out);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue