From 3d01c7824821688c9213e5789570cfc647f4cdb9 Mon Sep 17 00:00:00 2001 From: Berke Viktor Date: Sun, 21 Oct 2012 09:56:09 +0200 Subject: First bunch of fixes to SysInfo-Unix, now it works - barely --- plugins/sysinfo/pci.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'plugins/sysinfo/pci.c') diff --git a/plugins/sysinfo/pci.c b/plugins/sysinfo/pci.c index 221df850..aba04e68 100644 --- a/plugins/sysinfo/pci.c +++ b/plugins/sysinfo/pci.c @@ -27,8 +27,6 @@ #include #include "xsys.h" -#define PCIIDS "/usr/share/misc/pci.ids" - static struct pci_filter filter; /* Device filter */ static struct pci_access *pacc; int bus, dev, func; /* Location of the card */ @@ -112,9 +110,15 @@ int pci_find_by_class(u16 *class, char *vendor, char *device) void pci_find_fullname(char *fullname, char *vendor, char *device) { - char buffer[bsize], vendorname[bsize/2] = "", devicename[bsize/2] = "", *position; + char buffer[bsize]; + char vendorname[bsize/2] = ""; + char devicename[bsize/2] = ""; + char *position; int cardfound = 0; - FILE *fp = fopen(PCIIDS, "r"); + + sysinfo_get_pciids (buffer); + FILE *fp = fopen (buffer, "r"); + if(fp == NULL) { snprintf(fullname, bsize, "%s:%s", vendor, device); return; -- cgit 1.4.1