[syslinux] [PATCH 2/2] core: Fix stack overflow when reloading config

H. Peter Anvin hpa at zytor.com
Wed Feb 10 13:36:33 PST 2016


On 02/03/2016 07:16 AM, Celelibi via Syslinux wrote:
> 
> However, is there something similar for file descriptors? I also think
> I've seen some file descriptors never closed.
> 

All file descriptors are part of the files[] array, so it would be
trivial to implement a close_all_files() function:

void close_all_files(void)
{
	int i;
	struct file *file = files;

	for (i = 0; i < MAX_OPEN; i++) {
		if (file->fs)
			_close_file(file);
		file++;
	}
}

	-hpa



More information about the Syslinux mailing list