From: David Marchand Date: Tue, 26 Aug 2014 14:11:38 +0000 (+0200) Subject: eal/bsd: fix fd leak X-Git-Tag: spdx-start~10382 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;ds=inline;h=8a312224bcdeb45a36685b7c517c12d00683b24d;p=dpdk.git 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 Acked-by: Thomas Monjalon --- diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c index df1946cc43..ae21e2866b 100644 --- a/lib/librte_eal/bsdapp/eal/eal.c +++ b/lib/librte_eal/bsdapp/eal/eal.c @@ -497,6 +497,7 @@ rte_eal_iopl_init(void) fd = open("/dev/io", O_RDWR); if (fd < 0) return -1; + close(fd); return 0; }