Is it considered to be ok to not check the return code of close(2) in base?
Poul-Henning Kamp
phk at phk.freebsd.dk
Fri Dec 29 23:27:04 UTC 2017
--------
In message <24acbd94-c52f-e71a-8a96-d608a10963c6 at rawbw.com>, Yuri writes:
>Some base utilities sometimes close files that they open for their
>purposes without checking the error code of close(2).
My personal policy has become to always assert the return value of
close(2) calls and to leave the asserts in the production code since
they cost nothing in practice.
--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
More information about the freebsd-hackers
mailing list