[Spread-cvs] commit: r536 - trunk/libspread

jschultz at spread.org jschultz at spread.org
Fri Jul 13 15:57:49 EDT 2012


Author: jschultz
Date: 2012-07-13 15:57:49 -0400 (Fri, 13 Jul 2012)
New Revision: 536

Modified:
   trunk/libspread/sp.c
Log:
Slight code cleanup (no effect).


Modified: trunk/libspread/sp.c
===================================================================
--- trunk/libspread/sp.c	2012-07-12 20:00:59 UTC (rev 535)
+++ trunk/libspread/sp.c	2012-07-13 19:57:49 UTC (rev 536)
@@ -1090,7 +1090,6 @@
 	int		i;
         int             buf_len;
 	int		ret;
-	int             tmp;
 
         /* zero head_buf to avoid information leakage */
         memset( head_buf, 0, sizeof(message_header) + MAX_GROUP_NAME*num_groups );
@@ -1148,8 +1147,7 @@
             {
 		Alarm( SESSION, "SP_internal_multicast: error %d sending header and groups on mailbox %d: %s \n", ret, mbox, sock_strerror(sock_errno));
                 Mutex_lock( &Struct_mutex );
-                tmp = SP_get_session( mbox );
-                if( tmp != ses ){
+                if( ses != SP_get_session( mbox ) ){
                     Alarmp( SPLOG_INFO, SESSION, "SP_internal_multicast: Session disappeared on us, possible in threaded apps that "
 			    "don't externally synchronize use and destruction of mailboxes properly (user race condition)!!!\n");
                     Mutex_unlock( &Struct_mutex );
@@ -1174,8 +1172,7 @@
 		{
 			Alarm( SESSION, "SP_internal_multicast: error %d sending message data on mailbox %d: %s \n", ret, mbox, sock_strerror(sock_errno));
                         Mutex_lock( &Struct_mutex );
-                        tmp = SP_get_session( mbox );
-                        if( tmp != ses ){
+                        if( ses != SP_get_session( mbox ) ){
 			    Alarmp( SPLOG_INFO, SESSION, "SP_internal_multicast: Session disappeared on us, possible in threaded apps that "
 				    "don't externally synchronize use and destruction of mailboxes properly (user race condition)\n");
                             Mutex_unlock( &Struct_mutex );
@@ -1234,7 +1231,6 @@
 	char		This_session_private_group[MAX_GROUP_NAME];
 	int		i;
         int32           old_type;
-	int             tmp;
 
 	/* lookup and validate the session */
 
@@ -1278,8 +1274,7 @@
 
 	Mutex_lock( &Struct_mutex );
 
-	tmp = SP_get_session( mbox );
-	if( tmp != ses ){
+	if( ses != SP_get_session( mbox ) ){
 		Mutex_unlock( &Struct_mutex );
                 Mutex_unlock( &Sessions[ses].recv_mutex );
 		return( ILLEGAL_SESSION );
@@ -1318,8 +1313,7 @@
                         {
                                 Alarm( SESSION, "SP_scat_receive: failed receiving header on session %d (ret: %d len: %d): %s\n", mbox, ret, len, sock_strerror(sock_errno) );
                                 Mutex_lock( &Struct_mutex );
-                                tmp = SP_get_session( mbox );
-                                if( tmp != ses ){
+                                if( ses != SP_get_session( mbox ) ){
 				    Alarmp( SPLOG_INFO, SESSION, "SP_scat_receive: Session disappeared on us, possible in threaded apps that "
 					    "don't externally synchronize use and destruction of mailboxes properly (user race condition)!!!\n");
                                     Mutex_unlock( &Struct_mutex );
@@ -1345,8 +1339,7 @@
                 if ( scat_mess->elements[i].len < 0 )   {
                         if ( !drop_semantics && !This_session_message_saved) {
                                 Mutex_lock( &Struct_mutex );
-                                tmp = SP_get_session( mbox );
-                                if( tmp != ses ){
+                                if( ses != SP_get_session( mbox ) ){
                                         Mutex_unlock( &Struct_mutex );
 					Mutex_unlock( &Sessions[ses].recv_mutex );
                                         return( ILLEGAL_SESSION );
@@ -1381,8 +1374,7 @@
                 if ( (head_ptr->num_groups > max_groups) || (head_ptr->data_len > max_mess_len) ) {
                         if (!This_session_message_saved) {
                                 Mutex_lock( &Struct_mutex );
-                                tmp = SP_get_session( mbox );
-                                if( tmp != ses ){
+                                if( ses != SP_get_session( mbox ) ){
                                         Mutex_unlock( &Struct_mutex );
 					Mutex_unlock( &Sessions[ses].recv_mutex );
                                         return( ILLEGAL_SESSION );
@@ -1469,8 +1461,7 @@
                                 Alarm( SESSION, "SP_scat_receive: failed receiving old_type for reject on session %d, ret is %d: %s\n", mbox, ret, sock_strerror(sock_errno));
 
                                 Mutex_lock( &Struct_mutex );
-                                tmp = SP_get_session( mbox );
-                                if( tmp != ses ){
+                                if( ses != SP_get_session( mbox ) ){
 				    Alarmp( SPLOG_INFO, SESSION, "SP_scat_receive: Session disappeared on us, possible in threaded apps that "
 					    "don't externally synchronize use and destruction of mailboxes properly (user race condition)!!!\n");
                                     Mutex_unlock( &Struct_mutex );
@@ -1510,8 +1501,7 @@
 			Alarm( SESSION, "SP_scat_receive: failed receiving groups on session %d, ret is %d: %s\n", mbox, ret, sock_strerror(sock_errno));
 
                         Mutex_lock( &Struct_mutex );
-                        tmp = SP_get_session( mbox );
-                        if( tmp != ses ){
+                        if( ses != SP_get_session( mbox ) ){
 				    Alarmp( SPLOG_INFO, SESSION, "SP_scat_receive: Session disappeared on us, possible in threaded apps that "
 					    "don't externally synchronize use and destruction of mailboxes properly (user race condition)!!!\n");
                             Mutex_unlock( &Struct_mutex );
@@ -1541,8 +1531,7 @@
                                        mbox, ret, sock_strerror(sock_errno) );
 
                                 Mutex_lock( &Struct_mutex );
-                                tmp = SP_get_session( mbox );
-                                if( tmp != ses ){
+                                if( ses != SP_get_session( mbox ) ){
 				    Alarmp( SPLOG_INFO, SESSION, "SP_scat_receive: Session disappeared on us, possible in threaded apps that "
 					    "don't externally synchronize use and destruction of mailboxes properly (user race condition)!!!\n");
                                     Mutex_unlock( &Struct_mutex );
@@ -1606,8 +1595,7 @@
                                mbox, ret, sock_strerror(sock_errno) );
 
                         Mutex_lock( &Struct_mutex );
-                        tmp = SP_get_session( mbox );
-                        if( tmp != ses ){
+                        if( ses != SP_get_session( mbox ) ){
 				    Alarmp( SPLOG_INFO, SESSION, "SP_scat_receive: Session disappeared on us, possible in threaded apps that "
 					    "don't externally synchronize use and destruction of mailboxes properly (user race condition)!!!\n");
                             Mutex_unlock( &Struct_mutex );
@@ -1780,8 +1768,7 @@
                                        mbox, ret, sock_strerror(sock_errno) );
 
                                 Mutex_lock( &Struct_mutex );
-                                tmp = SP_get_session( mbox );
-                                if( tmp != ses ){
+                                if( ses != SP_get_session( mbox ) ){
 				    Alarmp( SPLOG_INFO, SESSION, "SP_scat_receive: Session disappeared on us, possible in threaded apps that "
 					    "don't externally synchronize use and destruction of mailboxes properly (user race condition)!!!\n");
                                     Mutex_unlock( &Struct_mutex );
@@ -1801,8 +1788,7 @@
         /* Successful receive so clear saved_message info if any */
         if (This_session_message_saved) {
                 Mutex_lock( &Struct_mutex );
-                tmp = SP_get_session( mbox );
-                if( tmp != ses ){
+                if( ses != SP_get_session( mbox ) ){
                         Mutex_unlock( &Struct_mutex );
 			Mutex_unlock( &Sessions[ses].recv_mutex );
                         return( ILLEGAL_SESSION );




More information about the Spread-cvs mailing list