summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakov Smolic <jakov.smolic@sartura.hr>2021-01-01 19:04:23 +0100
committerDavid Seifert <soap@gentoo.org>2021-01-01 19:04:23 +0100
commitee2353247311d477ac24d91dead7b99f3b7ac6ec (patch)
tree048cd3395eecf4960d53a7d3caded563b8decdda /net-analyzer
parentdev-lang/python: Add a dep on autoconf-archive in 3.10 (diff)
downloadgentoo-ee2353247311d477ac24d91dead7b99f3b7ac6ec.tar.gz
gentoo-ee2353247311d477ac24d91dead7b99f3b7ac6ec.tar.bz2
gentoo-ee2353247311d477ac24d91dead7b99f3b7ac6ec.zip
net-analyzer/nagios-plugins-snmp: Fix build with gcc-10
Closes: https://bugs.gentoo.org/707454 Signed-off-by: Jakov Smolic <jakov.smolic@sartura.hr> Signed-off-by: David Seifert <soap@gentoo.org>
Diffstat (limited to 'net-analyzer')
-rw-r--r--net-analyzer/nagios-plugins-snmp/files/nagios-plugins-snmp-0.6.0-fno-common.patch83
-rw-r--r--net-analyzer/nagios-plugins-snmp/nagios-plugins-snmp-0.6.0-r2.ebuild4
2 files changed, 86 insertions, 1 deletions
diff --git a/net-analyzer/nagios-plugins-snmp/files/nagios-plugins-snmp-0.6.0-fno-common.patch b/net-analyzer/nagios-plugins-snmp/files/nagios-plugins-snmp-0.6.0-fno-common.patch
new file mode 100644
index 000000000000..5fd2ff1c2351
--- /dev/null
+++ b/net-analyzer/nagios-plugins-snmp/files/nagios-plugins-snmp-0.6.0-fno-common.patch
@@ -0,0 +1,83 @@
+--- a/src/nagios_common_snmp.c
++++ b/src/nagios_common_snmp.c
+@@ -1,5 +1,22 @@
+ #include "nagios_common_snmp.h"
+
++char plugin_name[30]; /* plugin name */
++char plugin_tmp_prefix[50];
++char output[MAX_OUTPUT];
++int output_overflow;
++char *p_output;
++char *o_host;
++int o_verb;
++char* error;
++int o_port,o_timeout;
++int o_help, o_verbose,o_version,o_v2c;
++int retries;
++int o_snmpver,snmp_bulk;
++char *o_community,*o_login,*o_passwd,*o_privpasswd;
++char *o_protocols[2],*o_authproto,*o_privproto;
++struct snmp_session session, *ss;
++
++
+ int init_plugins_gettext(){
+ if (setlocale( LC_ALL, "" )==NULL) return 1;
+ bindtextdomain( PACKAGE, LOCALEDIR );
+--- a/src/nagios_common_snmp.h
++++ b/src/nagios_common_snmp.h
+@@ -56,8 +56,8 @@ int init_plugins_gettext();
+ /*********************************** Utilities ****************************************/
+ /* cache utilities */
+
+-char plugin_name[30]; /* plugin name */
+-char plugin_tmp_prefix[50];
++extern char plugin_name[30]; /* plugin name */
++extern char plugin_tmp_prefix[50];
+
+ /* defined in configure script */
+ /*#define BASE_CACHE "/tmp/cache"*/
+@@ -71,12 +71,12 @@ int write_cache(snmp_table **descT,int num);
+
+ /* maximum caracters in ouput */
+ #define MAX_OUTPUT 500
+-char output[MAX_OUTPUT];
+-int output_overflow;
++extern char output[MAX_OUTPUT];
++extern int output_overflow;
+
+ /* maximum caracters for performance output label*/
+ #define MAX_LABEL_SIZE 50
+-char *p_output;
++extern char *p_output;
+
+ /* Put data in output */
+ void strcat_output(const char *string);
+@@ -143,18 +143,18 @@ int get_options (int narg, char* const valarg[],options_nagsnmp *liste, int n_li
+ #define TIMEOUT_DEFAULT 3
+
+ /* standard options */
+-char *o_host;
+-int o_verb;
+-char* error;
++extern char *o_host;
++extern int o_verb;
++extern char* error;
+ /* snmp options */
+-int o_port,o_timeout;
+-int o_help, o_verbose,o_version,o_v2c;
+-int retries;
+-int o_snmpver,snmp_bulk;
+-char *o_community,*o_login,*o_passwd,*o_privpasswd;
+-char *o_protocols[2],*o_authproto,*o_privproto;
++extern int o_port,o_timeout;
++extern int o_help, o_verbose,o_version,o_v2c;
++extern int retries;
++extern int o_snmpver,snmp_bulk;
++extern char *o_community,*o_login,*o_passwd,*o_privpasswd;
++extern char *o_protocols[2],*o_authproto,*o_privproto;
+ /* snmp sessions */
+-struct snmp_session session, *ss;
++extern struct snmp_session session, *ss;
+
+ /* Common options definition and check */
+ #define common_usage "[-v -V] -H <host> -C <snmp_community> [-2] | (-l login -x passwd [-X pass -L <authp>,<privp>) [-p <port>] [-t <timeout>]"
diff --git a/net-analyzer/nagios-plugins-snmp/nagios-plugins-snmp-0.6.0-r2.ebuild b/net-analyzer/nagios-plugins-snmp/nagios-plugins-snmp-0.6.0-r2.ebuild
index 6eb4daae21ea..005fd81aef64 100644
--- a/net-analyzer/nagios-plugins-snmp/nagios-plugins-snmp-0.6.0-r2.ebuild
+++ b/net-analyzer/nagios-plugins-snmp/nagios-plugins-snmp-0.6.0-r2.ebuild
@@ -19,7 +19,9 @@ DEPEND="
net-analyzer/net-snmp"
RDEPEND="${DEPEND}"
-S="${WORKDIR}/nagios-plugins-snmp"
+S="${WORKDIR}"/nagios-plugins-snmp
+
+PATCHES=( "${FILESDIR}"/${P}-fno-common.patch )
src_prepare() {
default