summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2011-10-18 17:27:30 +0000
committerThierry Vignaud <tv@mageia.org>2011-10-18 17:27:30 +0000
commit970e05ee2f5a202f42f643d925ebc066182b716b (patch)
tree5bb53d96c6996350b2db29157ee7c269f503c7bb
parent71f13252410901ded48879b4671e89258c356c4c (diff)
downloadldetect-970e05ee2f5a202f42f643d925ebc066182b716b.tar
ldetect-970e05ee2f5a202f42f643d925ebc066182b716b.tar.gz
ldetect-970e05ee2f5a202f42f643d925ebc066182b716b.tar.bz2
ldetect-970e05ee2f5a202f42f643d925ebc066182b716b.tar.xz
ldetect-970e05ee2f5a202f42f643d925ebc066182b716b.zip
(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)
-rw-r--r--NEWS2
-rw-r--r--pci.c5
2 files changed, 7 insertions, 0 deletions
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) {