From 14e62c77bd1ae6ef1d4048df2da96eeff8f7538f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 3 Aug 2007 10:40:53 -0700 Subject: [PATCH] Make scanpci exit cleanly if pci_system_init() fails. --- src/scanpci.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/scanpci.c b/src/scanpci.c index a3ec5c5..2c49d80 100644 --- a/src/scanpci.c +++ b/src/scanpci.c @@ -24,6 +24,7 @@ #include #include +#include #include "pciaccess.h" @@ -176,8 +177,11 @@ int main( int argc, char ** argv ) { struct pci_device_iterator * iter; struct pci_device * dev; + int ret; - pci_system_init(); + ret = pci_system_init(); + if (ret != 0) + err(1, "Couldn't initialize PCI system"); iter = pci_slot_match_iterator_create( NULL ); -- 2.11.0