diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-05-16 21:11:54 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-05-16 21:11:54 +0200 |
commit | b6005f3a457ff1b40b5fd342c63e2685e5f49b1c (patch) | |
tree | c296f44b69576e2fd89ce0da55dfb01551f82874 /sys/src/9/port | |
parent | 29c7ca80c9df8f805217be9bb9a9a083ff12912d (diff) |
avoid updating offset in pread; avoid diagnostic about vlong mask (charles forsyth)
Diffstat (limited to 'sys/src/9/port')
-rw-r--r-- | sys/src/9/port/sysfile.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/src/9/port/sysfile.c b/sys/src/9/port/sysfile.c index 451822917..4a36951c9 100644 --- a/sys/src/9/port/sysfile.c +++ b/sys/src/9/port/sysfile.c @@ -677,10 +677,12 @@ read(int fd, uchar *p, long n, vlong *offp) }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 @@ 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); |