[DRBD-cvs] svn commit by phil - r2963 - branches/drbd-8.0/drbd - Pointed out by Ernest. The function with side effects n

drbd-cvs at lists.linbit.com drbd-cvs at lists.linbit.com
Mon Jul 2 11:54:59 CEST 2007


Author: phil
Date: 2007-07-02 11:54:58 +0200 (Mon, 02 Jul 2007)
New Revision: 2963

Modified:
   branches/drbd-8.0/drbd/drbd_receiver.c
Log:
Pointed out by Ernest.

The function with side effects needs to be the most right
argument of the && operator.



Modified: branches/drbd-8.0/drbd/drbd_receiver.c
===================================================================
--- branches/drbd-8.0/drbd/drbd_receiver.c	2007-07-02 08:44:22 UTC (rev 2962)
+++ branches/drbd-8.0/drbd/drbd_receiver.c	2007-07-02 09:54:58 UTC (rev 2963)
@@ -2408,8 +2408,8 @@
 	if (nconn == WFReportParams ) nconn = Connected;
 
 	if (mdev->p_uuid && oconn <= Connected &&
-	    inc_local_if_state(mdev,Negotiating) &&
-	    peer_state.disk >= Negotiating) {
+	    peer_state.disk >= Negotiating &&
+	    inc_local_if_state(mdev,Negotiating) ) {
 		nconn=drbd_sync_handshake(mdev,peer_state.role,peer_state.disk);
 		dec_local(mdev);
 



More information about the drbd-cvs mailing list