From 97f1514d772b1982ae0fa66e1f172be7805189cd Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Wed, 31 May 2000 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 2000-05-31 --- pc/main.c | 2 +- port/devsd.c | 4 +++- port/sd.h | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pc/main.c b/pc/main.c index 0319f56e9b85c84062497d58aaa7047a9f497671..627ba2d4305cd98eab95471495ac281a6ee1481b 100644 --- a/pc/main.c +++ b/pc/main.c @@ -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, '!'); diff --git a/port/devsd.c b/port/devsd.c index 19fed982130e7901192531de5d93f130f4ecc9c4..d9b3c6615aaa30b562fdcb776ffec33a2468902b 100644 --- a/port/devsd.c +++ b/port/devsd.c @@ -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: diff --git a/port/sd.h b/port/sd.h index 4d0b4a98fd31fda55c8a773c70ff485866aa8f1c..a84fc78f60c2bfaeef27f68cd8cc619e9f8d5c0a 100644 --- a/port/sd.h +++ b/port/sd.h @@ -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;