New upstream version 17.11-rc3
[deb_dpdk.git] / lib / librte_eal / common / arch / ppc_64 / rte_cpuflags.c
index a8147c8..970a61c 100644 (file)
@@ -108,7 +108,7 @@ rte_cpu_get_features(hwcap_registers_t out)
        Elf64_auxv_t auxv;
 
        auxv_fd = open("/proc/self/auxv", O_RDONLY);
-       assert(auxv_fd);
+       assert(auxv_fd != -1);
        while (read(auxv_fd, &auxv,
                sizeof(Elf64_auxv_t)) == sizeof(Elf64_auxv_t)) {
                if (auxv.a_type == AT_HWCAP)
@@ -116,6 +116,7 @@ rte_cpu_get_features(hwcap_registers_t out)
                else if (auxv.a_type == AT_HWCAP2)
                        out[REG_HWCAP2] = auxv.a_un.a_val;
        }
+       close(auxv_fd);
 }
 
 /*