From 4a0af56c67b2a50398ac716116867da8632a31ef Mon Sep 17 00:00:00 2001 From: Jan Safranek Date: Tue, 15 Feb 2011 13:04:04 +0100 Subject: [PATCH] Use my_init instead of MY_INIT, the later one is not working with MySQL 5.5 --- net-snmp-5.6.1-mysql.patch | 14 ++++++++++++++ net-snmp.spec | 2 ++ 2 files changed, 16 insertions(+) create mode 100644 net-snmp-5.6.1-mysql.patch diff --git a/net-snmp-5.6.1-mysql.patch b/net-snmp-5.6.1-mysql.patch new file mode 100644 index 0000000..8e30853 --- /dev/null +++ b/net-snmp-5.6.1-mysql.patch @@ -0,0 +1,14 @@ +MySQL 5.5 does not export 'const char *my_progname', so MY_INIT cannot be used. + +diff -up net-snmp-5.6.1/apps/snmptrapd_sql.c.orig net-snmp-5.6.1/apps/snmptrapd_sql.c +--- net-snmp-5.6.1/apps/snmptrapd_sql.c.orig 2010-11-30 22:08:59.000000000 +0100 ++++ net-snmp-5.6.1/apps/snmptrapd_sql.c 2011-02-15 13:01:31.631486477 +0100 +@@ -434,7 +434,7 @@ netsnmp_mysql_init(void) + return -1; + } + +- MY_INIT("snmptrapd"); ++ my_init(); + + /** load .my.cnf values */ + load_defaults ("my", _sql.groups, ¬_argc, ¬_argv); diff --git a/net-snmp.spec b/net-snmp.spec index a7b6d28..4d7fee7 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -36,6 +36,7 @@ Patch6: net-snmp-5.5-perl-linking.patch Patch7: net-snmp-5.6-test-debug.patch Patch8: net-snmp-5.6.1-find-librpm.patch Patch9: net-snmp-5.6.1-rpm-modernize.patch +Patch10: net-snmp-5.6.1-mysql.patch Requires(post): chkconfig Requires(preun): chkconfig @@ -170,6 +171,7 @@ Net-SNMP toolkit library. %patch7 -p1 %patch8 -p1 %patch9 -p1 +%patch10 -p1 -b .mysql %build MIBS="host agentx smux \