From 970e05ee2f5a202f42f643d925ebc066182b716b Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Tue, 18 Oct 2011 17:27:30 +0000 Subject: (pci_probe) don't exit(1) on systems without pci arm systems don't always have pci busses so killing the app for this reasons is just bad idea. The workaround is to check for pci procfs files and if not found return an empty set. v1: by rtp v2: simplify (tv) --- NEWS | 2 ++ pci.c | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/NEWS b/NEWS index 83f77e2..93f386d 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +- don't exit(1) on systems without pci (eg: ARM) (rtp) + Version 0.11.1 - 1 December 2009, Thierry Vignaud - do not crash if there're more than 100 PCI devices diff --git a/pci.c b/pci.c index 5bd344f..dda2866 100644 --- a/pci.c +++ b/pci.c @@ -37,6 +37,11 @@ extern struct pciusb_entries pci_probe(void) { struct pci_dev *dev; char classbuf[128], vendorbuf[128], devbuf[128]; + r.nb = 0; + if ((access(proc_pci_path_default, R_OK) != 0) + || (proc_pci_path && (access(proc_pci_path_default, R_OK) != 0))) + return r; + pacc = pci_alloc(); if (proc_pci_path) { -- cgit v1.2.1