[DRBD-cvs] user by phil; Realized an other micro bug in the drbda...

drbd-user@lists.linbit.com drbd-user@lists.linbit.com
Mon, 14 Jun 2004 15:15:58 +0200 (CEST)


DRBD CVS committal

Author  : phil
Project : drbd
Module  : user

Dir     : drbd/user


Modified Files:
      Tag: rel-0_7-branch
	drbdadm_adjust.c 


Log Message:
Realized an other micro bug in the drbdadm adjust code. 
If the device has a on-disconnect=stand_alone set and the config
ommits the on-disconnect option completely, the adjust code
was did not reconfigured it. Fixed now.

===================================================================
RCS file: /var/lib/cvs/drbd/drbd/user/Attic/drbdadm_adjust.c,v
retrieving revision 1.1.2.17
retrieving revision 1.1.2.18
diff -u -3 -r1.1.2.17 -r1.1.2.18
--- drbdadm_adjust.c	14 Jun 2004 10:36:06 -0000	1.1.2.17
+++ drbdadm_adjust.c	14 Jun 2004 13:15:53 -0000	1.1.2.18
@@ -152,11 +152,14 @@
   int rv=0;
 
   sprintf(scs," %s = %%s\n",name);
-  fscanf(in,scs,value);
-  o=find_opt(base,name);
-  if(o) {
-    o->mentioned=1;
-    if(strcmp(o->value,value)) rv=1;
+  if(fscanf(in,scs,value)>0) {
+    o=find_opt(base,name);
+    if(o) {
+      o->mentioned=1;
+      if(strcmp(o->value,value)) rv=1;
+    } else {
+      rv=1;
+    }
   }
 
   //printf("check_opt_s(%s)=%d [value=%s]\n",name,rv,value);