>>>>> On Wed, 31 Aug 2011 21:53:06 +0200, Niels Baggesen
>>>>> <[email protected]> said:
NB> Fedora15 has MySQL 5.5 which does not like the MY_INIT call in
NB> snmptrapd_sql.
NB> May I suggest this fix:
NB> diff --git a/apps/snmptrapd_sql.c b/apps/snmptrapd_sql.c
NB> index c7433dc..74b660f 100644
NB> --- a/apps/snmptrapd_sql.c
NB> +++ b/apps/snmptrapd_sql.c
NB> @@ -437,8 +437,6 @@ netsnmp_mysql_init(void)
NB> return -1;
NB> }
NB> - MY_INIT("snmptrapd");
NB> -
NB> /** load .my.cnf values */
NB> load_defaults ("my", _sql.groups, ¬_argc, ¬_argv);
NB> for(i=0; i < not_argc; ++i) {
NB> An alternative is to replace it with my_init(), but I don't see why it
NB> should be required at all.
Quoting from one manual:
It is necessary for my_init() to be called early in the initialization
phase of a program's use of the MySQL library.
However, my_init() is automatically called by mysql_init(),
mysql_library_init(), mysql_server_init(), and mysql_connect(). If you
ensure that your program invokes one of those functions before any other
MySQL calls, there is no need to invoke my_init() explicitly.
A quick grep seems to indicate we're not calling those other functions.
Have you tested this change yet? Or does this just fix the compile?
--
Wes Hardaker
Please mail all replies to [email protected]
------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders