devaoe: really fix unit numbering, to be 0-based
This commit is contained in:
parent
796c41092a
commit
eb1be5b4df
1 changed files with 2 additions and 2 deletions
|
@ -949,7 +949,7 @@ aoegen(Chan *c, char *, Dirtab *, int, int s, Dir *dp)
|
|||
return unitgen(c, TYPE(c->qid), dp);
|
||||
case Qdevlinkdir:
|
||||
i = UNIT(c->qid);
|
||||
if(i > Maxunits || i > units.ref)
|
||||
if(i >= Maxunits || i >= units.ref)
|
||||
return -1;
|
||||
d = unit2dev(i);
|
||||
if(s == DEVDOTDOT){
|
||||
|
@ -1728,7 +1728,7 @@ newunit(void)
|
|||
{
|
||||
int x;
|
||||
|
||||
x = incref(&units);
|
||||
x = incref(&units)-1;
|
||||
if(x >= Maxunits){
|
||||
decref(&units);
|
||||
x = -1;
|
||||
|
|
Loading…
Reference in a new issue