avoid updating offset in pread; avoid diagnostic about vlong mask (charles forsyth)
This commit is contained in:
parent
29c7ca80c9
commit
b6005f3a45
1 changed files with 7 additions and 5 deletions
|
@ -677,10 +677,12 @@ read(int fd, uchar *p, long n, vlong *offp)
|
||||||
}else
|
}else
|
||||||
nnn = nn = devtab[c->type]->read(c, p, n, off);
|
nnn = nn = devtab[c->type]->read(c, p, n, off);
|
||||||
|
|
||||||
lock(c);
|
if((c->qid.type & QTDIR) || offp == nil){
|
||||||
c->devoffset += nn;
|
lock(c);
|
||||||
c->offset += nnn;
|
c->devoffset += nn;
|
||||||
unlock(c);
|
c->offset += nnn;
|
||||||
|
unlock(c);
|
||||||
|
}
|
||||||
|
|
||||||
poperror();
|
poperror();
|
||||||
cclose(c);
|
cclose(c);
|
||||||
|
@ -1278,7 +1280,7 @@ packoldstat(uchar *buf, Dir *d)
|
||||||
p += 28;
|
p += 28;
|
||||||
strncpy((char*)p, d->gid, 28);
|
strncpy((char*)p, d->gid, 28);
|
||||||
p += 28;
|
p += 28;
|
||||||
q = d->qid.path & ~DMDIR; /* make sure doesn't accidentally look like directory */
|
q = (ulong)d->qid.path & ~DMDIR; /* make sure doesn't accidentally look like directory */
|
||||||
if(d->qid.type & QTDIR) /* this is the real test of a new directory */
|
if(d->qid.type & QTDIR) /* this is the real test of a new directory */
|
||||||
q |= DMDIR;
|
q |= DMDIR;
|
||||||
PBIT32(p, q);
|
PBIT32(p, q);
|
||||||
|
|
Loading…
Reference in a new issue