eal/bsd: fix fd leak

From man(4) io:
"The initial implementation simply raised the IOPL of the current thread
when open(2) was called on the device. This behaviour is retained in the
current implementation as legacy support for both i386 and amd64."
    http://www.freebsd.org/cgi/man.cgi?query=io&sektion=4

Nothing prevents from closing it just after.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
This commit is contained in:
David Marchand 2014-08-26 16:11:38 +02:00 committed by Thomas Monjalon
parent 68fa37e021
commit 8a312224bc

View File

@ -497,6 +497,7 @@ rte_eal_iopl_init(void)
fd = open("/dev/io", O_RDWR);
if (fd < 0)
return -1;
close(fd);
return 0;
}