summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Marchand <david.marchand@6wind.com>2014-08-26 16:11:38 +0200
committerThomas Monjalon <thomas.monjalon@6wind.com>2014-09-29 14:39:09 +0200
commit8a312224bcdeb45a36685b7c517c12d00683b24d (patch)
tree5355f8bf62e69cd7a5ede186942ffcafb17994f1
parent68fa37e021a1c44c6b2a947cefc20eb61c729947 (diff)
downloaddpdk-8a312224bcdeb45a36685b7c517c12d00683b24d.zip
dpdk-8a312224bcdeb45a36685b7c517c12d00683b24d.tar.gz
dpdk-8a312224bcdeb45a36685b7c517c12d00683b24d.tar.xz
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>
-rw-r--r--lib/librte_eal/bsdapp/eal/eal.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c
index df1946c..ae21e28 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;
}