M pc/main.c => pc/main.c +1 -1
@@ 314,7 314,7 @@ bootargs(ulong base)
} else if(strncmp(cp, "sd", 2) == 0){
sprint(buf, "local!#S/sd%c%c/fs", *(cp+2), *(cp+3));
av[ac++] = pusharg(buf);
- } else if(strncmp(cp, "e!", 2) == 0)
+ } else if(strncmp(cp, "ether", 5) == 0)
av[ac++] = pusharg("-n");
if(buf[0]){
cp = strchr(buf, '!');
M port/devsd.c => port/devsd.c +3 -1
@@ 495,8 495,10 @@ sdopen(Chan* c, int omode)
break;
case Qraw:
unit = sdunit[UNIT(c->qid)];
- if(!canlock(&unit->rawinuse))
+ if(!canlock(&unit->rawinuse)){
+ c->flag &= ~COPEN;
error(Einuse);
+ }
unit->state = Rawcmd;
break;
case Qpart:
M port/sd.h => port/sd.h +1 -1
@@ 32,7 32,7 @@ typedef struct SDunit {
int nopen; /* of partitions on this unit */
int changed;
- Lock rawinuse;
+ Lock rawinuse; /* really just a test-and-set */
int state;
SDreq* req;
} SDunit;