Page MenuHomeFreeBSD

Fix test output when gzip is run with -tlv
ClosedPublic

Authored by thj on Jan 26 2022, 11:48 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 7 2024, 4:17 PM
Unknown Object (File)
Feb 12 2024, 12:21 PM
Unknown Object (File)
Jan 17 2024, 8:13 PM
Unknown Object (File)
Dec 25 2023, 2:54 AM
Unknown Object (File)
Dec 20 2023, 7:07 AM
Unknown Object (File)
Dec 19 2023, 2:54 AM
Unknown Object (File)
Nov 2 2023, 1:13 PM
Unknown Object (File)
Sep 18 2023, 12:55 AM
Subscribers

Details

Summary

When run with test, verbose and list we need to parse the file otherwise
the test output is "NOT OK" even for valid files

Test Plan

Create a test file, gzip and xz it. gzip -tlv will report "NOT OK" when
testing the file before and "OK" after.

$ dd if=/dev/random bs=1m count=1 | b64encode - > 1M.out
$ gzip 1M.out
$ xz -z 1M.out
$ gunzip -tlv ~/tmp/1M.out.xz
     1089356      1416525  23.0% /home/tj/tmp/1M.out.xz
/home/tj/tmp/1M.out.xz:   NOT OK
$ gunzip -tlv ~/tmp/1M.out.gz
method  crc     date  time    compressed uncompressed  ratio uncompressed_name
defla 563d46f5 Jan 26 11:39      1077905      1077550  -0.1% /home/tj/tmp/1M.out
/home/tj/tmp/1M.out.gz:   NOT OK

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

thj requested review of this revision.Jan 26 2022, 11:48 AM

I don't see any use in nanobsd or freebsd-wifi-build

This revision is now accepted and ready to land.Jan 26 2022, 3:45 PM

I don't see any use in nanobsd or freebsd-wifi-build

Whoops; wrong review, right comment. (approval was correct, though)

Reviewed By: allanjude

usr.bin/gzip/gzip.c
1660

Should we be doing close(fd) here?

This revision was automatically updated to reflect the committed changes.