ref: 210f638603b61c480445245ddd745a80ab66acaa
parent: 03bf911f261106eaa486e0a729ff8147c61168dd
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Mon May 16 17:11:54 EDT 2016
avoid updating offset in pread; avoid diagnostic about vlong mask (charles forsyth)
--- a/sys/src/9/port/sysfile.c
+++ b/sys/src/9/port/sysfile.c
@@ -677,10 +677,12 @@
}else
nnn = nn = devtab[c->type]->read(c, p, n, off);
- lock(c);
- c->devoffset += nn;
- c->offset += nnn;
- unlock(c);
+ if((c->qid.type & QTDIR) || offp == nil){+ lock(c);
+ c->devoffset += nn;
+ c->offset += nnn;
+ unlock(c);
+ }
poperror();
cclose(c);
@@ -1278,7 +1280,7 @@
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);
--
⑨