#include <inttypes.h>
#include <sys/stat.h>
#include <sys/mman.h>
+#include <sys/sysmacros.h>
#include <linux/pci_regs.h>
#if defined(RTE_ARCH_X86)
unsigned int buflen, int create)
{
struct rte_pci_addr *loc = &dev->addr;
- unsigned int uio_num;
+ int uio_num = -1;
struct dirent *e;
DIR *dir;
char dirname[PATH_MAX];
return -1;
/* create uio device if we've been asked to */
- if (internal_config.create_uio_dev && create &&
+ if (rte_eal_create_uio_dev() && create &&
pci_mknod_uio_dev(dstbuf, uio_num) < 0)
RTE_LOG(WARNING, EAL, "Cannot create /dev/uio%u\n", uio_num);
close(dev->intr_handle.uio_cfg_fd);
dev->intr_handle.uio_cfg_fd = -1;
}
- if (dev->intr_handle.fd) {
+ if (dev->intr_handle.fd >= 0) {
close(dev->intr_handle.fd);
dev->intr_handle.fd = -1;
dev->intr_handle.type = RTE_INTR_HANDLE_UNKNOWN;