Fixed a number of cases where a bits in an integer were tested

incorrectly, resulting in real (and nasty) bugs.
This commit is contained in:
Kees van Reeuwijk 2010-03-02 12:55:39 +00:00
parent 975efeac31
commit f3c98fdca2
3 changed files with 4 additions and 4 deletions

View File

@ -37,7 +37,7 @@ PUBLIC void rproc_dmp()
for (i=prev_i; i<NR_SYS_PROCS; i++) { for (i=prev_i; i<NR_SYS_PROCS; i++) {
rp = &rproc[i]; rp = &rproc[i];
rpub = &rprocpub[i]; rpub = &rprocpub[i];
if (! rp->r_flags & RS_IN_USE) continue; if (! (rp->r_flags & RS_IN_USE)) continue;
if (++n > 22) break; if (++n > 22) break;
printf("%13s %9d %5d %5s %3d/%1d %3u %8u %5dx %s", printf("%13s %9d %5d %5s %3d/%1d %3u %8u %5dx %s",
rpub->label, rpub->endpoint, rp->r_pid, rpub->label, rpub->endpoint, rp->r_pid,

View File

@ -26,7 +26,7 @@ PUBLIC int fs_newnode()
/* Try to allocate the inode */ /* Try to allocate the inode */
if( (rip = alloc_inode(dev, bits) ) == NIL_INODE) return(err_code); if( (rip = alloc_inode(dev, bits) ) == NIL_INODE) return(err_code);
if (bits & S_IFMT != S_IFIFO) { if ((bits & S_IFMT) != S_IFIFO) {
r = EIO; /* We only support pipes */ r = EIO; /* We only support pipes */
} else if ((get_block(dev, rip->i_num)) == NIL_BUF) } else if ((get_block(dev, rip->i_num)) == NIL_BUF)
r = EIO; r = EIO;

View File

@ -94,7 +94,7 @@ PUBLIC int do_unlink()
/* Also, if the sticky bit is set, only the owner of the file or a privileged /* Also, if the sticky bit is set, only the owner of the file or a privileged
user is allowed to unlink */ user is allowed to unlink */
if (vldirp->v_mode & S_ISVTX == S_ISVTX) { if ((vldirp->v_mode & S_ISVTX) == S_ISVTX) {
/* Look up inode of file to unlink to retrieve owner */ /* Look up inode of file to unlink to retrieve owner */
vp = advance(vldirp, PATH_RET_SYMLINK); vp = advance(vldirp, PATH_RET_SYMLINK);
if (vp != NIL_VNODE) { if (vp != NIL_VNODE) {
@ -136,7 +136,7 @@ PUBLIC int do_rename()
/* If the sticky bit is set, only the owner of the file or a privileged /* If the sticky bit is set, only the owner of the file or a privileged
user is allowed to rename */ user is allowed to rename */
if(old_dirp->v_mode & S_ISVTX == S_ISVTX) { if((old_dirp->v_mode & S_ISVTX) == S_ISVTX) {
/* Look up inode of file to unlink to retrieve owner */ /* Look up inode of file to unlink to retrieve owner */
vp = advance(old_dirp, PATH_RET_SYMLINK); vp = advance(old_dirp, PATH_RET_SYMLINK);
if (vp != NIL_VNODE) { if (vp != NIL_VNODE) {