]> git.pld-linux.org Git - packages/net-snmp.git/blob - net-snmp-libpci-init.patch
- do not allow hrSWInstalledTable query to use dpkg-query even if it finds it; REL 6
[packages/net-snmp.git] / net-snmp-libpci-init.patch
1 --- net-snmp-5.7/agent/mibgroup/if-mib/data_access/interface_linux.c.orig       2011-07-02 00:35:46.000000000 +0200
2 +++ net-snmp-5.7/agent/mibgroup/if-mib/data_access/interface_linux.c    2011-08-07 21:10:45.760672551 +0200
3 @@ -19,6 +19,18 @@
4  #ifdef HAVE_PCI_LOOKUP_NAME
5  #include <pci/pci.h>
6  static struct pci_access *pci_access;
7 +static int _net_snmp_pci_status = 1;
8 +
9 +static void _net_snmp_pci_error(char *msg, ...)
10 +{
11 +  va_list args;
12 +
13 +  va_start(args, msg);
14 +  snmp_log(LOG_ERR, "pcilib: ");
15 +  snmp_vlog(LOG_ERR, msg, args);
16 +  snmp_log(LOG_ERR, "\n");
17 +  _net_snmp_pci_status = 0;
18 +}
19  #endif
20  
21  #ifdef HAVE_LINUX_ETHTOOL_H
22 @@ -146,9 +158,15 @@
23  
24  #ifdef HAVE_PCI_LOOKUP_NAME
25      pci_access = pci_alloc();
26 -    if (pci_access)
27 +    if (pci_access) {
28 +       pci_access->error = _net_snmp_pci_error;
29         pci_init(pci_access);
30 -    else
31 +       if (_net_snmp_pci_status == 0) {
32 +           pci_cleanup(pci_access);
33 +           pci_access = NULL;
34 +           snmp_log(LOG_ERR, "Unable to create pci access method (libpci)\n");
35 +       }
36 +    } else
37         snmp_log(LOG_ERR, "Unable to create pci access method\n");
38  #endif
39  }
This page took 0.073847 seconds and 3 git commands to generate.