Is it considered to be ok to not check the return code of close(2) in base?
Conrad Meyer
cem at freebsd.org
Fri Jan 5 23:17:39 UTC 2018
On Fri, Jan 5, 2018 at 2:34 PM, Poul-Henning Kamp <phk at phk.freebsd.dk> wrote:
> Brookes suggestion, while well intentioned, wouldn't get very far,
> because it is common for shells and shell-like programs to do:
>
> for (i = 3; i < ALOT; i++)
> (void)close(i);
>
> To get rid of unwanted filedescriptors from syslog(3), getpwent(3) etc.
> in the child process.
>
> Yes, I know about closefrom(2), but a lot of programs still don't use it.
Hi,
That seems like a good way to quickly identify programs in base that
still do not use closefrom().
Best,
Conrad
More information about the freebsd-hackers
mailing list