mirror of
https://github.com/ckolivas/lrzip.git
synced 2025-12-06 07:12:00 +01:00
Display outputting message only if not testing.
This commit is contained in:
parent
326cd29dd1
commit
ef15ea28a8
8
main.c
8
main.c
|
|
@ -164,7 +164,7 @@ static int open_tmpoutfile(void)
|
||||||
{
|
{
|
||||||
int fd_out;
|
int fd_out;
|
||||||
|
|
||||||
if (STDOUT)
|
if (STDOUT && !TEST_ONLY)
|
||||||
print_verbose("Outputting to stdout.\n");
|
print_verbose("Outputting to stdout.\n");
|
||||||
if (control.tmpdir) {
|
if (control.tmpdir) {
|
||||||
control.outfile = realloc(NULL, strlen(control.tmpdir) + 16);
|
control.outfile = realloc(NULL, strlen(control.tmpdir) + 16);
|
||||||
|
|
@ -191,7 +191,6 @@ void dump_tmpoutfile(int fd_out)
|
||||||
FILE *tmpoutfp;
|
FILE *tmpoutfp;
|
||||||
int tmpchar;
|
int tmpchar;
|
||||||
|
|
||||||
print_verbose("Dumping temporary file to stdout.\n");
|
|
||||||
/* flush anything not yet in the temporary file */
|
/* flush anything not yet in the temporary file */
|
||||||
fsync(fd_out);
|
fsync(fd_out);
|
||||||
tmpoutfp = fdopen(fd_out, "r");
|
tmpoutfp = fdopen(fd_out, "r");
|
||||||
|
|
@ -200,12 +199,13 @@ void dump_tmpoutfile(int fd_out)
|
||||||
rewind(tmpoutfp);
|
rewind(tmpoutfp);
|
||||||
|
|
||||||
if (!TEST_ONLY) {
|
if (!TEST_ONLY) {
|
||||||
|
print_verbose("Dumping temporary file to stdout.\n");
|
||||||
while ((tmpchar = fgetc(tmpoutfp)) != EOF)
|
while ((tmpchar = fgetc(tmpoutfp)) != EOF)
|
||||||
putchar(tmpchar);
|
putchar(tmpchar);
|
||||||
|
fflush(stdout);
|
||||||
|
rewind(tmpoutfp);
|
||||||
}
|
}
|
||||||
fflush(stdout);
|
|
||||||
|
|
||||||
rewind(tmpoutfp);
|
|
||||||
if (unlikely(ftruncate(fd_out, 0)))
|
if (unlikely(ftruncate(fd_out, 0)))
|
||||||
fatal("Failed to ftruncate fd_out in dump_tmpoutfile\n");
|
fatal("Failed to ftruncate fd_out in dump_tmpoutfile\n");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue