changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: devsd: fix sddelpart() AGAIN

changeset 7168: 1a2f7f23c5bd
parent 7167: e4a7fe526ec5
child 7169: 94fca26a23d8
author: cinap_lenrek@felloff.net
date: Tue, 16 Apr 2019 16:25:33 +0200
files: sys/src/9/port/devsd.c
description: devsd: fix sddelpart() AGAIN

the previous "fix" missed to advance pp so after
we hit a invalid partition all following partitions
would be ignored.
     1.1--- a/sys/src/9/port/devsd.c
     1.2+++ b/sys/src/9/port/devsd.c
     1.3@@ -154,9 +154,7 @@ sddelpart(SDunit* unit, char* name)
     1.4 	 */
     1.5 	pp = unit->part;
     1.6 	for(i = 0; i < unit->npart; i++){
     1.7-		if(!pp->valid)
     1.8-			continue;
     1.9-		if(strcmp(name, pp->name) == 0)
    1.10+		if(pp->valid && strcmp(name, pp->name) == 0)
    1.11 			break;
    1.12 		pp++;
    1.13 	}