commit: r662 - branches/spread_4_2_debug/daemon

[email protected] Mon, 20 Jan 2014 22:19:10 -0500
Newsgroups gmane.network.spread.cvs
Message-ID <[email protected]>
Author: jschultz
Date: 2014-01-20 22:19:09 -0500 (Mon, 20 Jan 2014)
New Revision: 662

Modified:
   branches/spread_4_2_debug/daemon/configuration.c
   branches/spread_4_2_debug/daemon/configuration.h
   branches/spread_4_2_debug/daemon/membership.c
   branches/spread_4_2_debug/daemon/network.c
Log:
Print and whitespace changes


Modified: branches/spread_4_2_debug/daemon/configuration.c
===================================================================
--- branches/spread_4_2_debug/daemon/configuration.c	2014-01-21 02:54:48 UTC (rev 661)
+++ branches/spread_4_2_debug/daemon/configuration.c	2014-01-21 03:19:09 UTC (rev 662)
@@ -660,7 +660,8 @@
                 if( config->segments[i].num_procs > 0 )
                         return( config->segments[i].procs[0]->id );
         }
-        Alarm( EXIT, "Conf_leader: Empty configuration %c",Conf_print(config));
+	Conf_print( config );
+        Alarm( EXIT, "Conf_leader: Empty configuration\n" );
 	return( -1 );
 }
 
@@ -676,7 +677,8 @@
                         return( config->segments[i].procs[j]->id );
 		}
         }
-        Alarm( EXIT, "Conf_last: Empty configuration %c",Conf_print(config));
+	Conf_print( config );
+        Alarm( EXIT, "Conf_last: Empty configuration\n" );
 	return( -1 );
 }
 
@@ -686,8 +688,8 @@
 	{
 		return( config->segments[seg_index].procs[0]->id );
 	}
-        Alarm( EXIT, "Conf_seg_leader: Empty segment %d in Conf %c",
-		seg_index, Conf_print(config));
+	Conf_print( config );
+        Alarm( EXIT, "Conf_seg_leader: Empty segment %d in Conf\n", seg_index );
 	return( -1 );
 }
 
@@ -700,8 +702,8 @@
 		j = config->segments[seg_index].num_procs-1;
 		return( config->segments[seg_index].procs[j]->id );
 	}
-        Alarm( EXIT, "Conf_seg_leader: Empty segment %d in Conf %c",
-		seg_index, Conf_print(config));
+	Conf_print( config );
+        Alarm( EXIT, "Conf_seg_leader: Empty segment %d in Conf\n", seg_index );
         return(-1);
 }
 
@@ -721,7 +723,7 @@
 	sprintf( str, "%u.%u.%u.%u", i1, i2, i3, i4 );
 }
 
-char	Conf_print(configuration *config)
+int	Conf_print(configuration *config)
 {
 	int 	s,p,ret;
 	char	ip[16];
@@ -745,11 +747,11 @@
 		}
 	}
 	Alarm( PRINT, "====================\n" );
-	return( '\n' );
+	return( 0 );
 }
 
 
-char	Conf_print_procs(configuration *config)
+int	Conf_print_procs(configuration *config)
 {
 	int 	i;
 	char	ip[16];
@@ -765,7 +767,7 @@
                        ip, config->allprocs[i].num_if);
         }
 	Alarm( PRINT, "====================\n" );
-	return( '\n' );
+	return( 0 );
 }
 
 bool    Conf_get_dangerous_monitor_state(void)

Modified: branches/spread_4_2_debug/daemon/configuration.h
===================================================================
--- branches/spread_4_2_debug/daemon/configuration.h	2014-01-21 02:54:48 UTC (rev 661)
+++ branches/spread_4_2_debug/daemon/configuration.h	2014-01-21 03:19:09 UTC (rev 662)
@@ -112,8 +112,8 @@
 int             Conf_append_id_to_seg( segment *seg, int32u id);
 int	        Conf_num_procs_in_seg( configuration *config, int16 seg_index );
 void		Conf_id_to_str( int32u id, char *str );
-char 		Conf_print(configuration *config);
-char	        Conf_print_procs(configuration *config);
+int 		Conf_print(configuration *config);
+int	        Conf_print_procs(configuration *config);
 
 bool            Conf_in_reload_state(void);
 void            Conf_reload_state_begin(void);

Modified: branches/spread_4_2_debug/daemon/membership.c
===================================================================
--- branches/spread_4_2_debug/daemon/membership.c	2014-01-21 02:54:48 UTC (rev 661)
+++ branches/spread_4_2_debug/daemon/membership.c	2014-01-21 03:19:09 UTC (rev 662)
@@ -1732,14 +1732,12 @@
 
 	    if( my_rg_info->aru         > Aru ) {
 		new_rg_info->aru 	= my_rg_info->aru;
-		Alarmp( SPLOG_INFO, MEMB, "my_rg_info->aru (%d) > Aru (%d) -> setting new_rg_info->aru to my_rg_info\n", 
-		  my_rg_info->aru, Aru );
+		Alarmp( SPLOG_INFO, MEMB, "my_rg_info->aru (%d) > Aru (%d) -> setting new_rg_info->aru to my_rg_info\n", my_rg_info->aru, Aru );
 	    }
 
 	    if( my_rg_info->highest_seq > Highest_seq ) {
 		new_rg_info->highest_seq= my_rg_info->highest_seq;
-		Alarmp( SPLOG_INFO, MEMB, "my_rg_info->highest_seq (%d) > Highest_seq (%d) -> setting new_rg_info->highest_seq to my_rg_info\n", 
-		  my_rg_info->highest_seq, Highest_seq );
+		Alarmp( SPLOG_INFO, MEMB, "my_rg_info->highest_seq (%d) > Highest_seq (%d) -> setting new_rg_info->highest_seq to my_rg_info\n", my_rg_info->highest_seq, Highest_seq );
 	    }
 
 	    for( i=0; i < my_rg_info->num_holes; i++ )
@@ -1981,8 +1979,7 @@
                       *num_rings, num_bytes, Membership_id.proc_id, Membership_id.time); 
         }
 
-	Alarmp( SPLOG_INFO, MEMB, "Read_form2: updating Highest_seq %d -> %d; Aru %d -> %d\n", 
-	  Highest_seq, my_rg_info->highest_seq, Aru, my_rg_info->aru );
+	Alarmp( SPLOG_INFO, MEMB, "Read_form2: updating Highest_seq %d -> %d; Aru %d -> %d\n", Highest_seq, my_rg_info->highest_seq, Aru, my_rg_info->aru );
 
 	Highest_seq = my_rg_info->highest_seq;
 	Aru	    = my_rg_info->aru;
@@ -2231,8 +2228,7 @@
 	int	pack_entry;
 	int	i;
 
-	Alarmp( SPLOG_INFO, MEMB, "Backoff_membership entered: Last_discarded = %d; Highest_seq = %d; Aru = %d; My_aru = %d\n", 
-	  Last_discarded, Highest_seq, Aru, My_aru );
+	Alarmp( SPLOG_INFO, MEMB, "Backoff_membership entered: Last_discarded = %d; Highest_seq = %d; Aru = %d; My_aru = %d\n", Last_discarded, Highest_seq, Aru, My_aru );
 
 	pack_entry=-1;
 	for( i=Last_discarded+1; i <= Highest_seq; i++ )
@@ -2256,8 +2252,7 @@
 		My_aru++;
 	}
 
-	Alarmp( SPLOG_INFO, MEMB, "Backoff_membership leaving: Last_discarded = %d; Highest_seq = %d; Aru = %d; My_aru = %d\n", 
-	  Last_discarded, Highest_seq, Aru, My_aru );
+	Alarmp( SPLOG_INFO, MEMB, "Backoff_membership leaving: Last_discarded = %d; Highest_seq = %d; Aru = %d; My_aru = %d\n", Last_discarded, Highest_seq, Aru, My_aru );
 }
 
 void	Memb_commit()
@@ -2350,8 +2345,9 @@
 	if( Conf_leader( &Membership ) == My.id )
 		E_queue( Memb_lookup_new_members, 0, NULL, Lookup_timeout );
 
-	printf("Membership id is ( %d, %d)\n", Membership_id.proc_id, Membership_id.time );
-	printf("%c", Conf_print( &Membership ) );
+	Alarm( PRINT, "Membership id is ( %d, %d)\n", Membership_id.proc_id, Membership_id.time );
+	Conf_print( &Membership );
+	Alarm( PRINT, "\n" );
 
         Shift_to_op();
 }

Modified: branches/spread_4_2_debug/daemon/network.c
===================================================================
--- branches/spread_4_2_debug/daemon/network.c	2014-01-21 02:54:48 UTC (rev 661)
+++ branches/spread_4_2_debug/daemon/network.c	2014-01-21 03:19:09 UTC (rev 662)
@@ -172,9 +172,10 @@
 	Net_membership = memb;
 	my_seg = Net_membership.segments[My.seg_index];
 	my_index_in_seg = Conf_id_in_seg( &my_seg, My.id );
-	if( my_index_in_seg < 0 )
-		Alarm( EXIT,"Net_set_membership: I am not in membership %c",
-			Conf_print( &Net_membership ) );
+	if( my_index_in_seg < 0 ) {
+		Conf_print( &Net_membership );
+		Alarm( EXIT, "Net_set_membership: I am not in membership\n" );
+	}
 	else if( my_index_in_seg == 0) {
 		Segment_leader = 1;
 		Alarm( NETWORK,"Net_set_membership: I am a Segment leader\n");