inetd fd leak?

Cathey, Jim jcathey at ciena.com
Fri Sep 4 22:01:28 UTC 2009


>fcntl(LogFile, F_SETFD, 1); /* 1 == FD_CLOEXEC */
>Oops, I missed the tricky (and strange) hardcoding of the constant,

Maybe not so strange, considering that the magic '1' was
the old-school value for a whole lot of years.  The
same school that used close(0), rather than close(FD_STDIN)
(or whatever it is).  Sometimes old habits die hard...

-- Jim






More information about the busybox mailing list