[syslinux] CMENU file handling problems.

H. Peter Anvin hpa at zytor.com
Mon Dec 6 13:26:24 PST 2010


On 12/05/2010 03:23 PM, arcarlini at iee.org wrote:
> 
> Poking around a bit further it seems that after ~29 attempts like this:
> 
> FILE* ifp;
> const char* fname = "/some/file/that/does/NOT/exist";
> 
> if ((ifp = fopen(fname, "r")) == 0) {
>   // code for failure
> } else {
>   // code for success
>   fclose(ifp);
> }
> 
> then a simple fopen(name, "r") of a file that *does* exist fails,
> even though that exact same fopen will succeed if I try it before
> the ~29 fopen()s on a file that foes not exist.
> 

Sounds like some kind of file descriptor leak, indeed.  The number 29 is
particularly suspicious: 32-3 (for stdin/stdout/stderr).

	-hpa




More information about the Syslinux mailing list