lib9p/hjfs: use x != ~0 instead (type)~x conditionals to work arround arm compiler issue
This commit is contained in:
parent
da2d0ee780
commit
505bc9b491
|
@ -716,16 +716,16 @@ chanwstat(Chan *ch, Dir *di)
|
||||||
ingroup(ch->fs, ch->uid, d->gid, 1) ||
|
ingroup(ch->fs, ch->uid, d->gid, 1) ||
|
||||||
(ch->fs->flags & FSNOPERM) != 0 ||
|
(ch->fs->flags & FSNOPERM) != 0 ||
|
||||||
(ch->flags & CHFNOPERM) != 0;
|
(ch->flags & CHFNOPERM) != 0;
|
||||||
if((uvlong)~di->length){
|
if(di->length != ~0){
|
||||||
if(isdir && di->length != 0)
|
if(isdir && di->length != 0)
|
||||||
goto inval;
|
goto inval;
|
||||||
if((ch->flags & CHFNOPERM) == 0)
|
if((ch->flags & CHFNOPERM) == 0)
|
||||||
if(di->length != d->size && !permcheck(ch->fs, d, ch->uid, OWRITE))
|
if(di->length != d->size && !permcheck(ch->fs, d, ch->uid, OWRITE))
|
||||||
goto perm;
|
goto perm;
|
||||||
}
|
}
|
||||||
if((ulong)~di->mtime && !owner)
|
if(di->mtime != ~0 && !owner)
|
||||||
goto perm;
|
goto perm;
|
||||||
if((ulong)~di->mode && !owner)
|
if(di->mode != ~0 && !owner)
|
||||||
goto perm;
|
goto perm;
|
||||||
nuid = NOUID;
|
nuid = NOUID;
|
||||||
ngid = NOUID;
|
ngid = NOUID;
|
||||||
|
@ -737,13 +737,13 @@ chanwstat(Chan *ch, Dir *di)
|
||||||
goto inval;
|
goto inval;
|
||||||
if((nuid != NOUID || ngid != NOUID) && !owner)
|
if((nuid != NOUID || ngid != NOUID) && !owner)
|
||||||
goto perm;
|
goto perm;
|
||||||
if((uvlong)~di->length && !isdir){
|
if(di->length != ~0 && !isdir){
|
||||||
trunc(ch->fs, ch->loc, b, di->length);
|
trunc(ch->fs, ch->loc, b, di->length);
|
||||||
modified(ch, d);
|
modified(ch, d);
|
||||||
}
|
}
|
||||||
if((ulong)~di->mtime)
|
if(di->mtime != ~0)
|
||||||
d->mtime = di->mtime;
|
d->mtime = di->mtime;
|
||||||
if((ulong)~di->mode){
|
if(di->mode != ~0){
|
||||||
d->mode = d->mode & ~0777 | di->mode & 0777;
|
d->mode = d->mode & ~0777 | di->mode & 0777;
|
||||||
ch->loc->type = d->type = di->mode >> 24;
|
ch->loc->type = d->type = di->mode >> 24;
|
||||||
}
|
}
|
||||||
|
|
|
@ -668,15 +668,15 @@ swstat(Srv *srv, Req *r)
|
||||||
respond(r, Ebaddir);
|
respond(r, Ebaddir);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if((ushort)~r->d.type){
|
if(r->d.type != (ushort)~0){
|
||||||
respond(r, "wstat -- attempt to change type");
|
respond(r, "wstat -- attempt to change type");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if((uint)~r->d.dev){
|
if(r->d.dev != ~0){
|
||||||
respond(r, "wstat -- attempt to change dev");
|
respond(r, "wstat -- attempt to change dev");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if((uchar)~r->d.qid.type || (ulong)~r->d.qid.vers || (uvlong)~r->d.qid.path){
|
if(r->d.qid.type != (uchar)~0 || r->d.qid.vers != ~0 || r->d.qid.path != ~0){
|
||||||
respond(r, "wstat -- attempt to change qid");
|
respond(r, "wstat -- attempt to change qid");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -684,7 +684,7 @@ swstat(Srv *srv, Req *r)
|
||||||
respond(r, "wstat -- attempt to change muid");
|
respond(r, "wstat -- attempt to change muid");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if((ulong)~r->d.mode && ((r->d.mode&DMDIR)>>24) != (r->fid->qid.type&QTDIR)){
|
if(r->d.mode != ~0 && ((r->d.mode&DMDIR)>>24) != (r->fid->qid.type&QTDIR)){
|
||||||
respond(r, "wstat -- attempt to change DMDIR bit");
|
respond(r, "wstat -- attempt to change DMDIR bit");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue