[DRBD-cvs] r1668 - branches/drbd-0.7/user

svn at svn.drbd.org svn at svn.drbd.org
Mon Dec 6 18:48:06 CET 2004


Author: phil
Date: 2004-12-06 18:48:04 +0100 (Mon, 06 Dec 2004)
New Revision: 1668

Modified:
   branches/drbd-0.7/user/drbdadm_main.c
Log:
Hmmm, made my last change sane.


Modified: branches/drbd-0.7/user/drbdadm_main.c
===================================================================
--- branches/drbd-0.7/user/drbdadm_main.c	2004-12-06 13:40:49 UTC (rev 1667)
+++ branches/drbd-0.7/user/drbdadm_main.c	2004-12-06 17:48:04 UTC (rev 1668)
@@ -628,8 +628,11 @@
     char *c;
 
     c=res->me->device;
-    while(!isdigit(*c)) c++; // Find the first digit in the device name...
-    return strtol(c,NULL,10);
+    while(*c) {
+      if(isdigit(*c)) return strtol(c,NULL,10);
+      c++;
+    }
+    return 0;
   }
 
   return minor(sb.st_rdev);
@@ -1188,6 +1191,9 @@
       nr_resources++;
     }
 
+    // Just for the case that minor_of_res() returned 0 for all devices.
+    if( nr_resources > (highest_minor+1) ) highest_minor=nr_resources-1;
+
     if( mc && mc<(highest_minor+1) ) {
       fprintf(stderr,"The highest minor you have in your config is %d"
 	      "but a minor_count of %d in your config!\n", highest_minor,mc);



More information about the drbd-cvs mailing list