=== modified file 'sql/rpl_rli.cc'
--- sql/rpl_rli.cc	2009-02-04 16:11:20 +0000
+++ sql/rpl_rli.cc	2009-02-10 13:47:31 +0000
@@ -35,6 +35,7 @@
    no_storage(FALSE), replicate_same_server_id(::replicate_same_server_id),
    info_fd(-1), cur_log_fd(-1), 
    relay_log(&sync_relaylog_period), sync_counter(0),
+   is_relay_log_recovery(relay_log_recovery),
    save_temporary_tables(0),
    cur_log_old_open_count(0), group_relay_log_pos(0), event_relay_log_pos(0),
 #if HAVE_purify

=== modified file 'sql/slave.cc'
--- sql/slave.cc	2009-02-04 16:11:20 +0000
+++ sql/slave.cc	2009-02-10 13:48:28 +0000
@@ -220,6 +220,7 @@
 int init_slave()
 {
   DBUG_ENTER("init_slave");
+  int error= 0;
 
   /*
     This is called when mysqld starts. Before client connections are
@@ -233,7 +234,10 @@
   */
 
   if (pthread_key_create(&RPL_MASTER_INFO, NULL))
+  {
+    error= 1;
     goto err;
+  }
 
   active_mi= new Master_info;
 
@@ -245,6 +249,7 @@
   if (!active_mi)
   {
     sql_print_error("Failed to allocate memory for the master info structure");
+    error= 1;
     goto err;
   }
 
@@ -252,12 +257,15 @@
                        1, (SLAVE_IO | SLAVE_SQL)))
   {
     sql_print_error("Failed to initialize the master info structure");
+    error= 1;
     goto err;
   }
 
-  active_mi->rli.is_relay_log_recovery= relay_log_recovery;
   if (active_mi->rli.is_relay_log_recovery && init_recovery(active_mi))
+  {
+    error= 1;
     goto err;
+  }
 
   /* If server id is not set, start_slave_thread() will say it */
 
@@ -271,17 +279,15 @@
                             SLAVE_IO | SLAVE_SQL))
     {
       sql_print_error("Failed to create slave threads");
+      error= 1;
       goto err;
     }
   }
-  active_mi->rli.is_relay_log_recovery= 0;
-  pthread_mutex_unlock(&LOCK_active_mi);
-  DBUG_RETURN(0);
 
 err:
   active_mi->rli.is_relay_log_recovery= 0;
   pthread_mutex_unlock(&LOCK_active_mi);
-  DBUG_RETURN(1);
+  DBUG_RETURN(error);
 }
 
 /*



