]> git.pld-linux.org Git - packages/net-snmp.git/commitdiff
- fix uber-stupid behaviour of libpci init error not returning but exiting the program
authorJan Rękorajski <baggins@pld-linux.org>
Sun, 7 Aug 2011 19:12:59 +0000 (19:12 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    net-snmp-libpci-init.patch -> 1.1
    net-snmp.spec -> 1.184

net-snmp-libpci-init.patch [new file with mode: 0644]
net-snmp.spec

diff --git a/net-snmp-libpci-init.patch b/net-snmp-libpci-init.patch
new file mode 100644 (file)
index 0000000..b29ce26
--- /dev/null
@@ -0,0 +1,37 @@
+--- net-snmp-5.7/agent/mibgroup/if-mib/data_access/interface_linux.c.orig      2011-07-02 00:35:46.000000000 +0200
++++ net-snmp-5.7/agent/mibgroup/if-mib/data_access/interface_linux.c   2011-08-07 21:10:45.760672551 +0200
+@@ -19,6 +19,18 @@
+ #ifdef HAVE_PCI_LOOKUP_NAME
+ #include <pci/pci.h>
+ static struct pci_access *pci_access;
++static int _net_snmp_pci_status = 1;
++
++static void _net_snmp_pci_error(char *msg, ...)
++{
++  va_list args;
++
++  va_start(args, msg);
++  fputs("pcilib: ", stderr);
++  vfprintf(stderr, msg, args);
++  fputc('\n', stderr);
++  _net_snmp_pci_status = 0;
++}
+ #endif
+ #ifdef HAVE_LINUX_ETHTOOL_H
+@@ -146,9 +158,13 @@
+ #ifdef HAVE_PCI_LOOKUP_NAME
+     pci_access = pci_alloc();
+-    if (pci_access)
++    if (pci_access) {
+       pci_init(pci_access);
+-    else
++      if (_net_snmp_pci_status == 0) {
++          pci_cleanup(pci_access);
++          pci_access = NULL;
++      }
++    } else
+       snmp_log(LOG_ERR, "Unable to create pci access method\n");
+ #endif
+ }
index 8a00a1bb82a8a6fc98159fc444b41f20ccc1e63d..0f15b89ce124642f71bc5bd7c93cf92453995767 100644 (file)
@@ -26,7 +26,7 @@ Summary(ru.UTF-8):    Набор утилит для протокола SNMP от U
 Summary(uk.UTF-8):     Набір утиліт для протоколу SNMP від UC-Davis
 Name:          net-snmp
 Version:       5.7
-Release:       2
+Release:       2.1
 License:       BSD-like
 Group:         Networking/Daemons
 Source0:       http://downloads.sourceforge.net/net-snmp/%{name}-%{version}.tar.gz
@@ -55,6 +55,7 @@ Patch11:      %{name}-defaultconfig.patch
 Patch12:       %{name}-use-rpm-hrmib.patch
 Patch13:       %{name}-TCP_STATS_CACHE_TIMEOUT.patch
 Patch14:       %{name}-libnl.patch
+Patch15:       %{name}-libpci-init.patch
 URL:           http://www.net-snmp.org/
 BuildRequires: autoconf >= 2.63
 BuildRequires: automake
@@ -432,6 +433,7 @@ SNMP dla trzech wersji tego protokołu (SNMPv3, SNMPv2c, SNMPv1).
 %patch12 -p1
 %patch13 -p1
 %patch14 -p1
+%patch15 -p1
 
 %build
 %{__libtoolize}
This page took 0.088797 seconds and 4 git commands to generate.