--- lspci.c +++ lspci.c @@ -64,6 +64,9 @@ #define alloca xmalloc #endif +/* error return val */ +static int error = 0; + /* Our view of the PCI bus */ struct device { @@ -120,8 +123,10 @@ d->config = xmalloc(64); d->present = xmalloc(64); memset(d->present, 1, 64); - if (!pci_read_block(p, 0, d->config, 64)) - die("Unable to read the standard configuration space header"); + if (!pci_read_block(p, 0, d->config, 64)) { + fprintf (stderr, "Unable to read the standard configuration space header\n"); + error++; return d; + } if ((d->config[PCI_HEADER_TYPE] & 0x7f) == PCI_HEADER_TYPE_CARDBUS) { /* For cardbus bridges, we need to fetch 64 bytes more to get the @@ -2401,5 +2406,5 @@ } pci_cleanup(pacc); - return 0; + return (error? 2: 0); }