summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoriko Hosoi <nhosoi@redhat.com>2010-07-02 15:44:23 -0700
committerNoriko Hosoi <nhosoi@redhat.com>2010-07-23 13:30:42 -0700
commit51796b5efab4f1a760f4bb2298ede7fcfa2c40ca (patch)
tree1c64399f39814525ea56c662beed37c1bef7d140
parent2c2b3ecea9f478bc0e7308ace741ee9e2429acb7 (diff)
610281 - fix coverity Defect Type: Control flow issues
https://bugzilla.redhat.com/show_bug.cgi?id=610281 11808 DEADCODE Triaged Unassigned Bug Minor Fix Required replication_multimaster_plugin_init() ds/ldap/servers/plugins/replication/repl5_init.c Comment: There used to be an initializing replica hash code between the line 573 and 575: 572 /* initialize replica hash - has to be done before mapping tree is 573 initialized so we can't do it in the start function */ 575 if (rc != 0) 576 { Execution cannot reach this statement "slapi_log_error(0, repl_plu...". 577 slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, 578 "replication_multimaster_plugin_init: failed to initialize replica hash\n"); 579 return -1; 580 } The initializing replica hash code was moved out but the comment and the result checking code were left. Removing them. Also, setting non 0 value to a static int variable multimaster_initialised if the plugin registration was successful.
-rw-r--r--ldap/servers/plugins/replication/repl5_init.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/ldap/servers/plugins/replication/repl5_init.c b/ldap/servers/plugins/replication/repl5_init.c
index 9d8776ad..8d4eb1c0 100644
--- a/ldap/servers/plugins/replication/repl5_init.c
+++ b/ldap/servers/plugins/replication/repl5_init.c
@@ -571,18 +571,8 @@ int replication_multimaster_plugin_init(Slapi_PBlock *pb)
*/
multimaster_mtnode_extension_init ();
- if(rc==0 && !multimaster_initialised)
+ if(!multimaster_initialised)
{
- /* initialize replica hash - has to be done before mapping tree is
- initialized so we can't do it in the start function */
-
- if (rc != 0)
- {
- slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name,
- "replication_multimaster_plugin_init: failed to initialize replica hash\n");
- return -1;
- }
-
/* Initialize extensions */
repl_con_init_ext();
repl_sup_init_ext();
@@ -603,6 +593,10 @@ int replication_multimaster_plugin_init(Slapi_PBlock *pb)
rc= slapi_register_plugin("extendedop", 1 /* Enabled */, "multimaster_end_extop_init", multimaster_end_extop_init, "Multimaster replication end extended operation plugin", NULL, identity);
rc= slapi_register_plugin("extendedop", 1 /* Enabled */, "multimaster_total_extop_init", multimaster_total_extop_init, "Multimaster replication total update extended operation plugin", NULL, identity);
rc= slapi_register_plugin("extendedop", 1 /* Enabled */, "multimaster_response_extop_init", multimaster_response_extop_init, "Multimaster replication extended response plugin", NULL, identity);
+ if (0 == rc)
+ {
+ multimaster_initialised = 1;
+ }
}
return rc;
}