Copyright (C) 2003 Mikhail Terekhov

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
    
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Index: groups.c
===================================================================
RCS file: /storage/cvsroot/spread/daemon/groups.c,v
retrieving revision 1.13
diff -C3 -r1.13 groups.c
*** groups.c	8 Feb 2004 15:07:23 -0000	1.13
--- groups.c	11 Feb 2004 19:42:44 -0000
***************
*** 684,690 ****
  	group		*grp, *new_grp;
  	member		*mbr, *new_mbr;
  	int		needed;
! 	int32		*num_vs_ptr; /* num members in virtual-synchrony/failure-atomicity set */
  	int		num_bytes;
  	char		proc_name[MAX_PROC_NAME];
  	char		private_name[MAX_PRIVATE_NAME+1];
--- 684,690 ----
  	group		*grp, *new_grp;
  	member		*mbr, *new_mbr;
  	int		needed;
! 	char		*num_vs_ptr; /* num members in virtual-synchrony/failure-atomicity set */
  	int		num_bytes;
  	char		proc_name[MAX_PROC_NAME];
  	char		private_name[MAX_PRIVATE_NAME+1];
***************
*** 824,830 ****
  					head_ptr->type |= CAUSED_BY_JOIN ;
  
  					/* notify all local members */
! 					num_vs_ptr = (int32 *)&Mess_buf[ num_bytes ];
  					num_bytes += sizeof( int32 );
                                          temp = 1;
                                          memcpy( num_vs_ptr, &temp, sizeof( int32 ) ); /* *num_vs_ptr = 1; */
--- 824,830 ----
  					head_ptr->type |= CAUSED_BY_JOIN ;
  
  					/* notify all local members */
! 					num_vs_ptr = &Mess_buf[ num_bytes ];
  					num_bytes += sizeof( int32 );
                                          temp = 1;
                                          memcpy( num_vs_ptr, &temp, sizeof( int32 ) ); /* *num_vs_ptr = 1; */
***************
*** 892,898 ****
  						head_ptr = Message_get_message_header(joiner_msg);
  						head_ptr->type |= CAUSED_BY_NETWORK ;
  						/* build a self vs set */
! 						num_vs_ptr = (int32 *)&Mess_buf[ num_bytes ];
  						num_bytes += sizeof( int32 );
                                                  temp = 1;
                                                  memcpy( num_vs_ptr, &temp, sizeof( int32 ) ); /* *num_vs_ptr = 1; */
--- 892,898 ----
  						head_ptr = Message_get_message_header(joiner_msg);
  						head_ptr->type |= CAUSED_BY_NETWORK ;
  						/* build a self vs set */
! 						num_vs_ptr = &Mess_buf[ num_bytes ];
  						num_bytes += sizeof( int32 );
                                                  temp = 1;
                                                  memcpy( num_vs_ptr, &temp, sizeof( int32 ) ); /* *num_vs_ptr = 1; */
***************
*** 1022,1028 ****
  	proc		p, p1;
  	group		*grp;
  	member		*mbr;
! 	int32		*num_vs_ptr; /* num members in vs set */
  	char		*vs_ptr;     /* the virtual synchrony set */
  	message_link	*mess_link;
  	message_header	*head_ptr;
--- 1022,1028 ----
  	proc		p, p1;
  	group		*grp;
  	member		*mbr;
! 	char		*num_vs_ptr; /* num members in vs set */
  	char		*vs_ptr;     /* the virtual synchrony set */
  	message_link	*mess_link;
  	message_header	*head_ptr;
***************
*** 1147,1153 ****
  			head_ptr->type |= CAUSED_BY_LEAVE ;
  
  			/* notify all local members */
! 			num_vs_ptr = (int32 *)&Mess_buf[ num_bytes ];
  			num_bytes += sizeof( int32 );
                          temp = 1;
                          memcpy( num_vs_ptr, &temp, sizeof( int32 ) ); /* *num_vs_ptr = 1; */
--- 1147,1153 ----
  			head_ptr->type |= CAUSED_BY_LEAVE ;
  
  			/* notify all local members */
! 			num_vs_ptr = &Mess_buf[ num_bytes ];
  			num_bytes += sizeof( int32 );
                          temp = 1;
                          memcpy( num_vs_ptr, &temp, sizeof( int32 ) ); /* *num_vs_ptr = 1; */
***************
*** 1219,1225 ****
  	proc		p, p1;
  	group		*grp, *nextgroup;
  	member		*mbr;
! 	int32		*num_vs_ptr; /* num members in vs set */
  	char		*vs_ptr;     /* the virtual synchrony set */
  	message_link	*mess_link;
  	message_header	*head_ptr;
--- 1219,1225 ----
  	proc		p, p1;
  	group		*grp, *nextgroup;
  	member		*mbr;
! 	char		*num_vs_ptr; /* num members in vs set */
  	char		*vs_ptr;     /* the virtual synchrony set */
  	message_link	*mess_link;
  	message_header	*head_ptr;
***************
*** 1341,1347 ****
  
  				head_ptr->type |= CAUSED_BY_DISCONNECT ;
  
! 				num_vs_ptr = (int32 *)&Mess_buf[ num_bytes ];
  				num_bytes += sizeof( int32 );
                                  temp = 1;
                                  memcpy( num_vs_ptr, &temp, sizeof( int32 ) ); /* *num_vs_ptr = 1; */
--- 1341,1347 ----
  
  				head_ptr->type |= CAUSED_BY_DISCONNECT ;
  
! 				num_vs_ptr = &Mess_buf[ num_bytes ];
  				num_bytes += sizeof( int32 );
                                  temp = 1;
                                  memcpy( num_vs_ptr, &temp, sizeof( int32 ) ); /* *num_vs_ptr = 1; */
***************
*** 1484,1490 ****
  	int		changed;
  	int		ret;
  	int		vs_bytes;
! 	int32		*num_vs_ptr; /* num members in virtual-synchrony/failure-atomicity set */
          int32           num_vs;
  	int		num_exist;
  	struct worklist *indices[MAX_PROCS_RING];
--- 1484,1490 ----
  	int		changed;
  	int		ret;
  	int		vs_bytes;
! 	char		*num_vs_ptr; /* num members in virtual-synchrony/failure-atomicity set */
          int32           num_vs;
  	int		num_exist;
  	struct worklist *indices[MAX_PROCS_RING];
***************
*** 1544,1550 ****
  	    group *this_group;
  	    /* prepare vs set */
  	    vs_bytes = 0;
! 	    num_vs_ptr = (int32 *)&Temp_buf[0];
  	    vs_bytes+= sizeof( int32 );
              num_vs = 0;
  	    
--- 1544,1550 ----
  	    group *this_group;
  	    /* prepare vs set */
  	    vs_bytes = 0;
! 	    num_vs_ptr = &Temp_buf[0];
  	    vs_bytes+= sizeof( int32 );
              num_vs = 0;
  	    
***************
*** 1859,1865 ****
  
  	int		num_bytes;
  	message_header	*head_ptr;
! 	int32		*num_vs_ptr; /* num members in virtual-synchrony/failure-atomicity set */
  	struct skiplistnode *iter;
          member          *mbr;
  	char		*membs_ptr;
--- 1859,1865 ----
  
  	int		num_bytes;
  	message_header	*head_ptr;
! 	char		*num_vs_ptr; /* num members in virtual-synchrony/failure-atomicity set */
  	struct skiplistnode *iter;
          member          *mbr;
  	char		*membs_ptr;
***************
*** 1870,1876 ****
  
  	head_ptr->type = head_ptr->type | caused;
  
! 	num_vs_ptr = (int32 *)&buf[num_bytes];
  	num_bytes += sizeof( int32 );
          head_ptr->data_len += sizeof( int32 );
          num_vs = 0;
--- 1870,1876 ----
  
  	head_ptr->type = head_ptr->type | caused;
  
! 	num_vs_ptr = &buf[num_bytes];
  	num_bytes += sizeof( int32 );
          head_ptr->data_len += sizeof( int32 );
          num_vs = 0;
***************
*** 1925,1931 ****
  	char		*gid_ptr;
  	member		*mbr;
  	struct skiplistnode *giter, *iter;
! 	int16		*num_memb_ptr;
          int16           num_memb;
  	char		*memb_ptr;
          int     size_for_this_group;
--- 1925,1931 ----
  	char		*gid_ptr;
  	member		*mbr;
  	struct skiplistnode *giter, *iter;
! 	char		*num_memb_ptr;
          int16           num_memb;
  	char		*memb_ptr;
          int     size_for_this_group;
***************
*** 1955,1961 ****
  		num_bytes += sizeof( group_id );
  		memcpy( gid_ptr, &grp->grp_id, sizeof(group_id) );
  
! 		num_memb_ptr = (int16 *)&buf[num_bytes];
  		num_bytes += sizeof( int16 );
  		num_memb  = 0;
  
--- 1955,1961 ----
  		num_bytes += sizeof( group_id );
  		memcpy( gid_ptr, &grp->grp_id, sizeof(group_id) );
  
! 		num_memb_ptr = &buf[num_bytes];
  		num_bytes += sizeof( int16 );
  		num_memb  = 0;
  
***************
*** 1992,1998 ****
  	group		*grp;
  	char		*gid_ptr;
  	member		*mbr;
! 	int16		*num_memb_ptr;
          int16           num_memb;
  	int		i;
  
--- 1992,1998 ----
  	group		*grp;
  	char		*gid_ptr;
  	member		*mbr;
! 	char		*num_memb_ptr;
          int16           num_memb;
  	int		i;
  
***************
*** 2041,2047 ****
  		num_bytes += sizeof( group_id );
  		memcpy( &grp->grp_id, gid_ptr, sizeof(group_id) );
  
! 		num_memb_ptr = (int16 *)&Temp_buf[num_bytes];
  		num_bytes += sizeof( int16 );
                  memcpy( &num_memb, num_memb_ptr, sizeof( int16 ) );
  
--- 2041,2047 ----
  		num_bytes += sizeof( group_id );
  		memcpy( &grp->grp_id, gid_ptr, sizeof(group_id) );
  
! 		num_memb_ptr = &Temp_buf[num_bytes];
  		num_bytes += sizeof( int16 );
                  memcpy( &num_memb, num_memb_ptr, sizeof( int16 ) );
  
