[Commits] Rev 2912: support building with -all-static (no dlopen and dlclose make few in http://bazaar.launchpad.net/~maria-captains/maria/5.2/

serg at askmonty.org serg at askmonty.org
Thu Jan 20 13:56:39 EET 2011


At http://bazaar.launchpad.net/~maria-captains/maria/5.2/

------------------------------------------------------------
revno: 2912
revision-id: sergii at pisem.net-20110120115629-mdc597dpai5v4ioj
parent: sergii at pisem.net-20110114210221-a01uz5qv4aefy8zi
fixes bug(s): https://launchpad.net/bugs/705210
committer: Sergei Golubchik <sergii at pisem.net>
branch nick: 5.2
timestamp: Thu 2011-01-20 12:56:29 +0100
message:
  support building with -all-static (no dlopen and dlclose make few
  related declarations unused or "statement have no effect") and -Werror
-------------- next part --------------
=== modified file 'sql-common/client_plugin.c'
--- a/sql-common/client_plugin.c	2011-01-14 21:02:21 +0000
+++ b/sql-common/client_plugin.c	2011-01-20 11:56:29 +0000
@@ -50,7 +50,8 @@ struct st_client_plugin_int {
 static my_bool initialized= 0;
 static MEM_ROOT mem_root;
 
-static const char *plugin_declarations_sym= "_mysql_client_plugin_declaration_";
+static const char *plugin_declarations_sym __attribute__((unused)) =
+                                "_mysql_client_plugin_declaration_";
 static uint plugin_version[MYSQL_CLIENT_MAX_PLUGINS]=
 {
   0, /* these two are taken by Connector/C */
@@ -180,7 +181,7 @@ add_plugin(MYSQL *mysql, struct st_mysql
     plugin->deinit();
 err1:
   if (dlhandle)
-    dlclose(dlhandle);
+    (void)dlclose(dlhandle);
   set_mysql_extended_error(mysql, CR_AUTH_PLUGIN_CANNOT_LOAD, unknown_sqlstate,
                            ER(CR_AUTH_PLUGIN_CANNOT_LOAD), plugin->name,
                            errmsg);
@@ -287,7 +288,7 @@ void mysql_client_plugin_deinit()
       if (p->plugin->deinit)
         p->plugin->deinit();
       if (p->dlhandle)
-        dlclose(p->dlhandle);
+        (void)dlclose(p->dlhandle);
     }
 
   bzero(&plugin_list, sizeof(plugin_list));
@@ -365,7 +366,7 @@ mysql_load_plugin_v(MYSQL *mysql, const 
   if (!(sym= dlsym(dlhandle, plugin_declarations_sym)))
   {
     errmsg= "not a plugin";
-    dlclose(dlhandle);
+    (void)dlclose(dlhandle);
     goto err;
   }
 

=== modified file 'sql/sql_plugin_services.h'
--- a/sql/sql_plugin_services.h	2010-03-03 14:44:14 +0000
+++ b/sql/sql_plugin_services.h	2011-01-20 11:56:29 +0000
@@ -36,7 +36,7 @@ static struct thd_alloc_service_st thd_a
   thd_make_lex_string
 };
 
-static struct st_service_ref list_of_services[]=
+static struct st_service_ref list_of_services[] __attribute__((unused)) =
 {
   { "my_snprintf_service", VERSION_my_snprintf, &my_snprintf_handler },
   { "thd_alloc_service",   VERSION_thd_alloc,   &thd_alloc_handler }



More information about the commits mailing list