From: Kees van Reeuwijk Date: Tue, 2 Mar 2010 12:55:39 +0000 (+0000) Subject: Fixed a number of cases where a bits in an integer were tested X-Git-Tag: v3.1.7~263 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/CHANGES?a=commitdiff_plain;h=f3c98fdca20d486b9f4a0593cbffa5da1155564a;p=minix.git Fixed a number of cases where a bits in an integer were tested incorrectly, resulting in real (and nasty) bugs. --- diff --git a/servers/is/dmp_rs.c b/servers/is/dmp_rs.c index eb1d1925f..aa81fca05 100644 --- a/servers/is/dmp_rs.c +++ b/servers/is/dmp_rs.c @@ -37,7 +37,7 @@ PUBLIC void rproc_dmp() for (i=prev_i; ir_flags & RS_IN_USE) continue; + if (! (rp->r_flags & RS_IN_USE)) continue; if (++n > 22) break; printf("%13s %9d %5d %5s %3d/%1d %3u %8u %5dx %s", rpub->label, rpub->endpoint, rp->r_pid, diff --git a/servers/pfs/open.c b/servers/pfs/open.c index 39026241c..59d2e1625 100644 --- a/servers/pfs/open.c +++ b/servers/pfs/open.c @@ -26,7 +26,7 @@ PUBLIC int fs_newnode() /* Try to allocate the inode */ 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 */ } else if ((get_block(dev, rip->i_num)) == NIL_BUF) r = EIO; diff --git a/servers/vfs/link.c b/servers/vfs/link.c index 4d44aea76..a74da279e 100644 --- a/servers/vfs/link.c +++ b/servers/vfs/link.c @@ -94,7 +94,7 @@ PUBLIC int do_unlink() /* Also, if the sticky bit is set, only the owner of the file or a privileged 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 */ vp = advance(vldirp, PATH_RET_SYMLINK); 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 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 */ vp = advance(old_dirp, PATH_RET_SYMLINK); if (vp != NIL_VNODE) {