New upstream version 18.11
[deb_dpdk.git] / lib / librte_eal / bsdapp / eal / eal.c
index 508cbc4..b8152a7 100644 (file)
@@ -556,9 +556,11 @@ int rte_eal_has_hugepages(void)
 int
 rte_eal_iopl_init(void)
 {
-       static int fd;
+       static int fd = -1;
+
+       if (fd < 0)
+               fd = open("/dev/io", O_RDWR);
 
-       fd = open("/dev/io", O_RDWR);
        if (fd < 0)
                return -1;
        /* keep fd open for iopl */