PERFORCE change 81960 for review

soc-cjones soc-cjones at FreeBSD.org
Sun Aug 14 00:30:08 GMT 2005


http://perforce.freebsd.org/chv.cgi?CH=81960

Change 81960 by soc-cjones at soc-cjones_ishtar on 2005/08/14 00:29:16

	Meh.

Affected files ...

.. //depot/projects/soc2005/gvinum/src/sys/geom/vinum/geom_vinum_share.c#2 edit

Differences ...

==== //depot/projects/soc2005/gvinum/src/sys/geom/vinum/geom_vinum_share.c#2 (text+ko) ====

@@ -573,10 +573,12 @@
 	s->drive_offset = -1;
 	errors = 0;
 	for (j = 1; j < max; j++) {
+	    /*	  printf("gv_new_sd: token = '%s'\n", token[j]); */
 		if (!strcmp(token[j], "name")) {
 			j++;
 			if (j >= max) {
 				errors++;
+				/*				printf("breaking on name '%s'\n", token[j]); */
 				break;
 			}
 			strncpy(s->name, token[j], GV_MAXSDNAME);
@@ -584,6 +586,7 @@
 			j++;
 			if (j >= max) {
 				errors++;
+				/*				printf("breaking on drive '%s'\n", token[j]); */
 				break;
 			}
 			strncpy(s->drive, token[j], GV_MAXDRIVENAME);
@@ -591,6 +594,7 @@
 			j++;
 			if (j >= max) {
 				errors++;
+				/*				printf("breaking on plex '%s'\n", token[j]); */
 				break;
 			}
 			strncpy(s->plex, token[j], GV_MAXPLEXNAME);
@@ -598,6 +602,7 @@
 			j++;
 			if (j >= max) {
 				errors++;
+				/*				printf("breaking on state '%s'\n", token[j]); */
 				break;
 			}
 			s->state = gv_sdstatei(token[j]);
@@ -606,6 +611,7 @@
 			j++;
 			if (j >= max) {
 				errors++;
+				/*				printf("breakign on length '%s'\n", token[j]); */
 				break;
 			}
 			s->size = gv_sizespec(token[j]);
@@ -615,33 +621,42 @@
 			j++;
 			if (j >= max) {
 				errors++;
+				/*				printf("breaking on driveoffset '%s'\n", token[j]); */
 				break;
 			}
 			s->drive_offset = gv_sizespec(token[j]);
 			if (s->drive_offset != 0 &&
 			    s->drive_offset < GV_DATA_START) {
 				errors++;
+				/*				printf("breaking on invalid drive offset\n"); */
 				break;
 			}
 		} else if (!strcmp(token[j], "plexoffset")) {
 			j++;
 			if (j >= max) {
 				errors++;
+				/*				printf("breaking on plexoffset '%s'\n", token[j]); */
 				break;
 			}
 			s->plex_offset = gv_sizespec(token[j]);
 			if (s->plex_offset < 0) {
 				errors++;
+				/*				printf("breaking on invalid plexoffset\n"); */
 				break;
 			}
 		} else {
 			errors++;
+			/*			printf("breaking on invalid token '%s'\n", token[j]); */
 			break;
 		}
 	}
 
-	if (strlen(s->drive) == 0)
+	if (strlen(s->drive) == 0) {
 		errors++;
+		/*		printf("dying on NULL drive\n");
+		printf("fixing to refer to alpha\n");
+		snprintf(s->drive, GV_MAXDRIVENAME, "alpha"); */
+	}
 
 	if (errors) {
 		g_free(s);


More information about the p4-projects mailing list