#include <sys/io.h>
#endif
+#include <rte_string_fns.h>
#include <rte_log.h>
#include <rte_pci.h>
#include <rte_bus_pci.h>
goto error;
}
- snprintf((*uio_res)->path, sizeof((*uio_res)->path), "%s", devname);
+ strlcpy((*uio_res)->path, devname, sizeof((*uio_res)->path));
memcpy(&(*uio_res)->pci_addr, &dev->addr, sizeof((*uio_res)->pci_addr));
return 0;
loc->domain, loc->bus, loc->devid,
loc->function, res_idx);
- if (access(devname, R_OK|W_OK) != -1) {
- fd = open(devname, O_RDWR);
- if (fd < 0)
- RTE_LOG(INFO, EAL, "%s cannot be mapped. "
- "Fall-back to non prefetchable mode.\n",
- devname);
+ fd = open(devname, O_RDWR);
+ if (fd < 0 && errno != ENOENT) {
+ RTE_LOG(INFO, EAL, "%s cannot be mapped. "
+ "Fall-back to non prefetchable mode.\n",
+ devname);
}
}