struct pci_dev *p;
int nomatch = 1;
+ /* libpci has no way to report errors it calls exit()
+ * so we need to manually avoid potential failures like this one */
+ if (!g_file_test ("/proc/bus/pci", G_FILE_TEST_EXISTS))
+ return 1;
+
pacc = pci_alloc();
pci_filter_init(pacc, &filter);
pci_init(pacc);
if (cardfound == 1)
g_snprintf(fullname, bsize, "%s %s", vendorname, devicename);
else
- g_snprintf(fullname, bsize, "%s:%s", vendor, device);
+ g_snprintf(fullname, bsize, "%s:%s", vendor, device);
fclose(fp);
}