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
|
||||
nnn = nn = devtab[c->type]->read(c, p, n, off);
|
||||
|
||||
if((c->qid.type & QTDIR) || offp == nil){
|
||||
lock(c);
|
||||
c->devoffset += nn;
|
||||
c->offset += nnn;
|
||||
unlock(c);
|
||||
}
|
||||
|
||||
poperror();
|
||||
cclose(c);
|
||||
|
@ -1278,7 +1280,7 @@ packoldstat(uchar *buf, Dir *d)
|
|||
p += 28;
|
||||
strncpy((char*)p, d->gid, 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 */
|
||||
q |= DMDIR;
|
||||
PBIT32(p, q);
|
||||
|
|
Loading…
Reference in a new issue