diff options
| author | Maxim Sobolev <sobomax@FreeBSD.org> | 2016-03-10 23:19:35 +0000 |
|---|---|---|
| committer | Maxim Sobolev <sobomax@FreeBSD.org> | 2016-03-10 23:19:35 +0000 |
| commit | 62ee4b69cd038bc55efbaeb27454ef07d39831b3 (patch) | |
| tree | e96bb8fb900f2b27d6b53c8a502de5886587f54a | |
| parent | 98790d33c663ccdee787af479b288fb8b6542dd6 (diff) | |
Notes
| -rw-r--r-- | usr.bin/mkuzip/mkuzip.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/usr.bin/mkuzip/mkuzip.c b/usr.bin/mkuzip/mkuzip.c index 49861971a52b..fa736538150b 100644 --- a/usr.bin/mkuzip/mkuzip.c +++ b/usr.bin/mkuzip/mkuzip.c @@ -90,7 +90,10 @@ int main(int argc, char **argv) char *iname, *oname, *obuf, *ibuf; uint64_t *toc; int fdr, fdw, i, opt, verbose, no_zcomp, tmp, en_dedup; - int summary; + struct { + int en; + FILE *f; + } summary; struct iovec iov[2]; struct stat sb; uint32_t destlen; @@ -105,7 +108,8 @@ int main(int argc, char **argv) verbose = 0; no_zcomp = 0; en_dedup = 0; - summary = 0; + summary.en = 0; + summary.f = stderr; handler = &uzip_fmt; while((opt = getopt(argc, argv, "o:s:vZdLS")) != -1) { @@ -141,7 +145,8 @@ int main(int argc, char **argv) break; case 'S': - summary = 1; + summary.en = 1; + summary.f = stdout; break; default: @@ -300,8 +305,8 @@ int main(int argc, char **argv) } close(fdr); - if (verbose != 0 || summary != 0) - fprintf(stderr, "compressed data to %ju bytes, saved %lld " + if (verbose != 0 || summary.en != 0) + fprintf(summary.f, "compressed data to %ju bytes, saved %lld " "bytes, %.2f%% decrease.\n", offset, (long long)(sb.st_size - offset), 100.0 * (long long)(sb.st_size - offset) / |
