[mythtv] open file handles and exec()

Matt Zimmerman mdz at debian.org
Sun Jul 13 23:35:07 EDT 2003


On Sun, Jul 13, 2003 at 09:25:33PM -0500, Geoffrey Hausheer wrote:

> On Sun, 13 Jul 2003 21:13:42 -0400, "Isaac Richards ijr-at-po.cwru.edu
> |mythtv/1.0-Allow|" <e6kbhbk35r0t at sneakemail.com> said:
> > On Sunday 13 July 2003 08:34 pm, Geoffrey Hausheer wrote:
> > > I have seen crude hacks like:
> > >    for (int i = 3; i < 9999; i++)
> > >      close(i);
> > >
> > > but that is just plain nasty.
> > 
> > It's really the easiest thing to do, though, right after forking.
> 
> If you prefer that solution, you don't need an explicit patch from me,
> just apply the above in transcoder.cpp :)

No; it should use sysconf rather than the arbitrary (and indeed, incorrect)
'9999'.  There is an example in the backend:

    for(int i = 3; i < sysconf(_SC_OPEN_MAX) - 1; ++i)
        close(i);

-- 
 - mdz


More information about the mythtv-dev mailing list