aboutsummaryrefslogtreecommitdiff
path: root/arch/linux/common/pci.h
diff options
context:
space:
mode:
authorAgney Lopes Roth Ferraz <agney@debian.org>2007-12-09 05:03:40 -0400
committerSimon Quigley <tsimonq2@ubuntu.com>2017-06-19 14:38:45 -0500
commit18e8f4ab62003cb2e251f1540d083114ad489123 (patch)
tree1685ab16402d10233f81c67aa4ad7cf857246d86 /arch/linux/common/pci.h
parent401ee3a8ee846998cf0fa3ebadcc81cffe1da3ed (diff)
parentee6c3f9b4cf08a276c971dee66e1acdb32b3dff9 (diff)
Import Debian changes 0.4.2.3-1
hardinfo (0.4.2.3-1) unstable; urgency=low * New upstream release.(Closes: #454947)
Diffstat (limited to 'arch/linux/common/pci.h')
-rw-r--r--arch/linux/common/pci.h32
1 files changed, 24 insertions, 8 deletions
diff --git a/arch/linux/common/pci.h b/arch/linux/common/pci.h
index 554c3dca..388ce9aa 100644
--- a/arch/linux/common/pci.h
+++ b/arch/linux/common/pci.h
@@ -21,16 +21,32 @@ __scan_pci(void)
{
FILE *lspci;
gchar buffer[256], *buf, *strhash = NULL, *strdevice = NULL;
- gchar *category = NULL, *name = NULL;
- gint n = 0;
-
- if (!(lspci = popen(LSPCI, "r"))) {
- goto pci_error;
+ gchar *category = NULL, *name = NULL, *icon;
+ gint n = 0, x = 0;
+
+ buf = g_build_filename(g_get_home_dir(), ".hardinfo", "pci.ids", NULL);
+ if (!g_file_test(buf, G_FILE_TEST_EXISTS)) {
+ DEBUG("using system-provided PCI IDs");
+ g_free(buf);
+ if (!(lspci = popen(LSPCI, "r"))) {
+ goto pci_error;
+ }
+ } else {
+ gchar *tmp;
+
+ tmp = g_strdup_printf("%s -i '%s'", LSPCI, buf);
+ g_free(buf);
+ buf = tmp;
+
+ DEBUG("using updated PCI IDs (from %s)", buf);
+ if (!(lspci = popen(tmp, "r"))) {
+ g_free(buf);
+ goto pci_error;
+ } else {
+ g_free(buf);
+ }
}
- gchar *icon;
-
- int x = 0; /* unique Memory, Capability and I/O port */
while (fgets(buffer, 256, lspci)) {
buf = g_strstrip(buffer);