Page MenuHomeFreeBSD

Fix a file descriptor leak in cmp(1)
ClosedPublic

Authored by asomers on Jan 6 2017, 10:41 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 26 2024, 8:15 AM
Unknown Object (File)
Jan 6 2024, 7:08 AM
Unknown Object (File)
Jan 6 2024, 7:08 AM
Unknown Object (File)
Jan 6 2024, 7:08 AM
Unknown Object (File)
Jan 6 2024, 7:08 AM
Unknown Object (File)
Jan 6 2024, 6:56 AM
Unknown Object (File)
Dec 22 2023, 11:00 PM
Unknown Object (File)
Dec 16 2023, 2:48 PM
Subscribers

Details

Summary

Fix a file descriptor leak in cmp(1)

Also, add a few test cases

Reported by: Coverity
CID: 271624

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 6609
Build 6827: arc lint + arc unit

Event Timeline

asomers retitled this revision from to Fix a file descriptor leak in cmp(1).
asomers updated this object.
asomers edited the test plan for this revision. (Show Details)
asomers added a reviewer: ngie.
contrib/netbsd-tests/usr.bin/cmp/t_cmp.sh
63–98

Please add # Begin FreeBSD and # End FreeBSD to denote the changes we added.

93

-e ignore -x for consistency?

usr.bin/cmp/special.c
102

What about fp2?

contrib/netbsd-tests/usr.bin/cmp/t_cmp.sh
63–98

I can do that, or I can create a separate test file for our tests. Which would you prefer?

93

Ok.

usr.bin/cmp/special.c
102

Grr, I should've seen that. Still, I wish Coverity would sanely sort its output.

contrib/netbsd-tests/usr.bin/cmp/t_cmp.sh
63–98

I think this makes sense. It might be a good idea to push this back to NetBSD..

Incorporate ngie's feedback

ngie edited edge metadata.
ngie added inline comments.
usr.bin/cmp/tests/Makefile
5–6 ↗(On Diff #23686)

Please...

  • use += to ensure that the value of ${ATF_TESTS_SH}
  • put ATF_TESTS_SH+= above NETBSD_ATF_TESTS_SH for sorting purposes.
This revision is now accepted and ready to land.Jan 7 2017, 12:37 AM
This revision was automatically updated to reflect the committed changes.