summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>1999-01-27 21:50:00 +0000
committerdillon <dillon@FreeBSD.org>1999-01-27 21:50:00 +0000
commita40e0249d4e2495009cf3fb552bc428d0a8a8676 (patch)
tree4c208238f4839fac2a65719e0587b7b1583d6224
parent143a811b84ef1bcf36b91153bfd028dca51265ef (diff)
downloadFreeBSD-src-a40e0249d4e2495009cf3fb552bc428d0a8a8676.zip
FreeBSD-src-a40e0249d4e2495009cf3fb552bc428d0a8a8676.tar.gz
Fix warnings in preparation for adding -Wall -Wcast-qual to the
kernel compile
-rw-r--r--sys/dev/iicbus/iiconf.h4
-rw-r--r--sys/dev/ppbus/ppb_msq.h20
-rw-r--r--sys/dev/ppbus/ppi.c4
-rw-r--r--sys/dev/snp/snp.c4
-rw-r--r--sys/fs/cd9660/cd9660_lookup.c12
-rw-r--r--sys/fs/cd9660/cd9660_node.c6
-rw-r--r--sys/fs/cd9660/cd9660_vfsops.c22
-rw-r--r--sys/fs/cd9660/cd9660_vnops.c17
-rw-r--r--sys/gnu/ext2fs/ext2_alloc.c2
-rw-r--r--sys/gnu/ext2fs/ext2_balloc.c18
-rw-r--r--sys/gnu/ext2fs/ext2_inode.c22
-rw-r--r--sys/gnu/ext2fs/ext2_linux_balloc.c4
-rw-r--r--sys/gnu/ext2fs/ext2_linux_ialloc.c4
-rw-r--r--sys/gnu/ext2fs/ext2_lookup.c32
-rw-r--r--sys/gnu/ext2fs/ext2_subr.c2
-rw-r--r--sys/gnu/ext2fs/ext2_vfsops.c36
-rw-r--r--sys/gnu/ext2fs/ext2_vnops.c4
-rw-r--r--sys/gnu/fs/ext2fs/ext2_alloc.c2
-rw-r--r--sys/gnu/fs/ext2fs/ext2_balloc.c18
-rw-r--r--sys/gnu/fs/ext2fs/ext2_inode.c22
-rw-r--r--sys/gnu/fs/ext2fs/ext2_linux_balloc.c4
-rw-r--r--sys/gnu/fs/ext2fs/ext2_linux_ialloc.c4
-rw-r--r--sys/gnu/fs/ext2fs/ext2_lookup.c32
-rw-r--r--sys/gnu/fs/ext2fs/ext2_subr.c2
-rw-r--r--sys/gnu/fs/ext2fs/ext2_vfsops.c36
-rw-r--r--sys/gnu/fs/ext2fs/ext2_vnops.c4
-rw-r--r--sys/isofs/cd9660/cd9660_lookup.c12
-rw-r--r--sys/isofs/cd9660/cd9660_node.c6
-rw-r--r--sys/isofs/cd9660/cd9660_vfsops.c22
-rw-r--r--sys/isofs/cd9660/cd9660_vnops.c17
-rw-r--r--sys/kern/imgact_elf.c28
-rw-r--r--sys/kern/kern_conf.c16
-rw-r--r--sys/kern/kern_exec.c4
-rw-r--r--sys/kern/kern_linker.c30
-rw-r--r--sys/kern/kern_lkm.c10
-rw-r--r--sys/kern/kern_lockf.c6
-rw-r--r--sys/kern/kern_malloc.c6
-rw-r--r--sys/kern/kern_module.c16
-rw-r--r--sys/kern/kern_threads.c4
-rw-r--r--sys/kern/kern_time.c4
-rw-r--r--sys/kern/link_elf.c24
-rw-r--r--sys/kern/link_elf_obj.c24
-rw-r--r--sys/kern/subr_bus.c14
-rw-r--r--sys/kern/sys_generic.c4
-rw-r--r--sys/kern/sys_pipe.c12
-rw-r--r--sys/kern/sys_process.c4
-rw-r--r--sys/kern/tty_snoop.c4
-rw-r--r--sys/kern/uipc_socket.c4
-rw-r--r--sys/kern/uipc_syscalls.c6
-rw-r--r--sys/kern/vfs_aio.c16
-rw-r--r--sys/kern/vfs_bio.c4
-rw-r--r--sys/kern/vfs_cluster.c4
-rw-r--r--sys/kern/vfs_extattr.c116
-rw-r--r--sys/kern/vfs_lookup.c4
-rw-r--r--sys/kern/vfs_syscalls.c116
-rw-r--r--sys/sys/linker.h5
-rw-r--r--sys/sys/malloc.h4
-rw-r--r--sys/sys/module.h4
-rw-r--r--sys/sys/vnode.h6
59 files changed, 454 insertions, 439 deletions
diff --git a/sys/dev/iicbus/iiconf.h b/sys/dev/iicbus/iiconf.h
index 0b548fb..d626ffe 100644
--- a/sys/dev/iicbus/iiconf.h
+++ b/sys/dev/iicbus/iiconf.h
@@ -23,14 +23,14 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: iiconf.h,v 1.2 1998/10/31 11:31:07 nsouch Exp $
+ * $Id: iiconf.h,v 1.3 1999/01/09 18:08:24 nsouch Exp $
*/
#ifndef __IICONF_H
#define __IICONF_H
#include <sys/queue.h>
-#define IICPRI PZERO+8 /* XXX sleep/wakeup queue priority */
+#define IICPRI (PZERO+8) /* XXX sleep/wakeup queue priority */
#define n(flags) (~(flags) & (flags))
diff --git a/sys/dev/ppbus/ppb_msq.h b/sys/dev/ppbus/ppb_msq.h
index 4bba299..7de698b 100644
--- a/sys/dev/ppbus/ppb_msq.h
+++ b/sys/dev/ppbus/ppb_msq.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ppb_msq.h,v 1.2 1998/09/13 18:26:26 nsouch Exp $
+ * $Id: ppb_msq.h,v 1.3 1999/01/10 12:04:54 nsouch Exp $
*
*/
#ifndef __PPB_MSQ_H
@@ -119,23 +119,23 @@
#define MS_RFETCH_P(n,reg,mask) { MS_OP_RFETCH_P, { n, reg, mask } }
/* ptr manipulation */
-#define MS_PTR(ptr) { MS_OP_PTR, { ptr } }
+#define MS_PTR(ptr) { MS_OP_PTR, { { ptr } } }
#define MS_DASS(byte) MS_RASSERT(MS_REG_DTR,byte)
#define MS_SASS(byte) MS_RASSERT(MS_REG_STR,byte)
#define MS_CASS(byte) MS_RASSERT(MS_REG_CTR,byte)
-#define MS_SET(accum) { MS_OP_SET, { accum } }
+#define MS_SET(accum) { MS_OP_SET, { { accum } } }
#define MS_BRSET(mask,offset) { MS_OP_BRSET, { mask, offset } }
-#define MS_DBRA(offset) { MS_OP_DBRA, { offset } }
-#define MS_BRCLEAR(mask,offset) { MS_OP_BRCLEAR, { mask, offset } }
+#define MS_DBRA(offset) { MS_OP_DBRA, { { offset } } }
+#define MS_BRCLEAR(mask,offset) { MS_OP_BRCLEAR, { { mask }, { offset } } }
#define MS_BRSTAT(mask_set,mask_clr,offset) \
{ MS_OP_BRSTAT, { mask_set, mask_clr, offset } }
/* C function or submicrosequence call */
#define MS_C_CALL(function,parameter) \
{ MS_OP_C_CALL, { function, parameter } }
-#define MS_CALL(microseq) { MS_OP_CALL, { microseq } }
+#define MS_CALL(microseq) { MS_OP_CALL, { { microseq } } }
/* mode dependent read/write operations
* ppb_MS_xxx_init() call required otherwise default is
@@ -144,14 +144,14 @@
#define MS_GET(ptr,len) { MS_OP_GET, { ptr, len } }
/* delay in microseconds */
-#define MS_DELAY(udelay) { MS_OP_DELAY, { udelay } }
+#define MS_DELAY(udelay) { MS_OP_DELAY, { { udelay } } }
/* asynchroneous delay in ms */
-#define MS_ADELAY(mdelay) { MS_OP_ADELAY, { mdelay } }
+#define MS_ADELAY(mdelay) { MS_OP_ADELAY, { { mdelay } } }
/* return from submicrosequence execution or microseqence execution */
-#define MS_SUBRET(code) { MS_OP_SUBRET, { code } }
-#define MS_RET(code) { MS_OP_RET, { code } }
+#define MS_SUBRET(code) { MS_OP_SUBRET, { { code } } }
+#define MS_RET(code) { MS_OP_RET, { { code } } }
/*
* Function abstraction level
diff --git a/sys/dev/ppbus/ppi.c b/sys/dev/ppbus/ppi.c
index e0072f3..95d7644 100644
--- a/sys/dev/ppbus/ppi.c
+++ b/sys/dev/ppbus/ppi.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ppi.c,v 1.8 1998/12/07 21:58:16 archie Exp $
+ * $Id: ppi.c,v 1.9 1999/01/10 12:04:55 nsouch Exp $
*
*/
#include "ppi.h"
@@ -449,7 +449,7 @@ ppiwrite(dev_t dev, struct uio *uio, int ioflag)
#endif
/* negociation done, write bytes to master host */
- while (len = min(uio->uio_resid, BUFSIZE)) {
+ while ((len = min(uio->uio_resid, BUFSIZE)) != 0) {
uiomove(ppi->ppi_buffer, len, uio);
if ((error = byte_peripheral_write(&ppi->ppi_dev,
ppi->ppi_buffer, len, &sent)))
diff --git a/sys/dev/snp/snp.c b/sys/dev/snp/snp.c
index ba71a94..686aa27 100644
--- a/sys/dev/snp/snp.c
+++ b/sys/dev/snp/snp.c
@@ -172,7 +172,7 @@ snpread(dev, uio, flag)
if (((nblen / 2) >= SNOOP_MINLEN) && (nblen / 2) >= snp->snp_len) {
while (((nblen / 2) >= snp->snp_len) && ((nblen / 2) >= SNOOP_MINLEN))
nblen = nblen / 2;
- if (nbuf = malloc(nblen, M_TTYS, M_NOWAIT)) {
+ if ((nbuf = malloc(nblen, M_TTYS, M_NOWAIT)) != NULL) {
bcopy(snp->snp_buf + snp->snp_base, nbuf, snp->snp_len);
free(snp->snp_buf, M_TTYS);
snp->snp_buf = nbuf;
@@ -291,7 +291,7 @@ snpopen(dev, flag, mode, p)
struct snoop *snp;
register int unit, error;
- if (error = suser(p->p_ucred, &p->p_acflag))
+ if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
return (error);
if ((unit = minor(dev)) >= NSNP)
diff --git a/sys/fs/cd9660/cd9660_lookup.c b/sys/fs/cd9660/cd9660_lookup.c
index 2f7baef..3d0ff74 100644
--- a/sys/fs/cd9660/cd9660_lookup.c
+++ b/sys/fs/cd9660/cd9660_lookup.c
@@ -38,7 +38,7 @@
* from: @(#)ufs_lookup.c 7.33 (Berkeley) 5/19/91
*
* @(#)cd9660_lookup.c 8.2 (Berkeley) 1/23/94
- * $Id: cd9660_lookup.c,v 1.19 1997/10/16 10:47:33 phk Exp $
+ * $Id: cd9660_lookup.c,v 1.20 1997/11/07 08:52:50 phk Exp $
*/
#include <sys/param.h>
@@ -181,8 +181,8 @@ searchloop:
if ((dp->i_offset & bmask) == 0) {
if (bp != NULL)
brelse(bp);
- if (error =
- cd9660_blkatoff(vdp, (off_t)dp->i_offset, NULL, &bp))
+ if ((error =
+ cd9660_blkatoff(vdp, (off_t)dp->i_offset, NULL, &bp)) != 0)
return (error);
entryoffsetinblock = 0;
}
@@ -279,8 +279,8 @@ foundino:
lblkno(imp, saveoffset)) {
if (bp != NULL)
brelse(bp);
- if (error = cd9660_blkatoff(vdp,
- (off_t)saveoffset, NULL, &bp))
+ if ((error = cd9660_blkatoff(vdp,
+ (off_t)saveoffset, NULL, &bp)) != 0)
return (error);
}
entryoffsetinblock = saveoffset & bmask;
@@ -410,7 +410,7 @@ cd9660_blkatoff(vp, offset, res, bpp)
lbn = lblkno(imp, offset);
bsize = blksize(imp, ip, lbn);
- if (error = bread(vp, lbn, bsize, NOCRED, &bp)) {
+ if ((error = bread(vp, lbn, bsize, NOCRED, &bp)) != 0) {
brelse(bp);
*bpp = NULL;
return (error);
diff --git a/sys/fs/cd9660/cd9660_node.c b/sys/fs/cd9660/cd9660_node.c
index edfd66c..9640d6e 100644
--- a/sys/fs/cd9660/cd9660_node.c
+++ b/sys/fs/cd9660/cd9660_node.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)cd9660_node.c 8.2 (Berkeley) 1/23/94
- * $Id: cd9660_node.c,v 1.25 1998/02/09 06:09:18 eivind Exp $
+ * $Id: cd9660_node.c,v 1.26 1999/01/02 11:34:54 bde Exp $
*/
#include <sys/param.h>
@@ -120,7 +120,7 @@ cd9660_ihashins(ip)
simple_lock(&cd9660_ihash_slock);
ipp = &isohashtbl[INOHASH(ip->i_dev, ip->i_number)];
- if (iq = *ipp)
+ if ((iq = *ipp) != NULL)
iq->i_prev = &ip->i_next;
ip->i_next = iq;
ip->i_prev = ipp;
@@ -140,7 +140,7 @@ cd9660_ihashrem(ip)
register struct iso_node *iq;
simple_lock(&cd9660_ihash_slock);
- if (iq = ip->i_next)
+ if ((iq = ip->i_next) != NULL)
iq->i_prev = ip->i_prev;
*ip->i_prev = iq;
#ifdef DIAGNOSTIC
diff --git a/sys/fs/cd9660/cd9660_vfsops.c b/sys/fs/cd9660/cd9660_vfsops.c
index 9e661a6..9560c3f 100644
--- a/sys/fs/cd9660/cd9660_vfsops.c
+++ b/sys/fs/cd9660/cd9660_vfsops.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)cd9660_vfsops.c 8.18 (Berkeley) 5/22/95
- * $Id: cd9660_vfsops.c,v 1.46 1998/12/06 11:36:24 jkh Exp $
+ * $Id: cd9660_vfsops.c,v 1.47 1999/01/17 20:41:02 peter Exp $
*/
#include <sys/param.h>
@@ -239,7 +239,7 @@ cd9660_mount(mp, path, data, ndp, p)
if ((mp->mnt_flag & MNT_RDONLY) == 0)
accessmode |= VWRITE;
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p);
- if (error = VOP_ACCESS(devvp, accessmode, p->p_ucred, p)) {
+ if ((error = VOP_ACCESS(devvp, accessmode, p->p_ucred, p)) != 0) {
vput(devvp);
return (error);
}
@@ -324,8 +324,8 @@ iso_mountfs(devvp, mp, p, argp)
for (iso_blknum = 16 + argp->ssector;
iso_blknum < 100 + argp->ssector;
iso_blknum++) {
- if (error = bread(devvp, iso_blknum * btodb(iso_bsize),
- iso_bsize, NOCRED, &bp))
+ if ((error = bread(devvp, iso_blknum * btodb(iso_bsize),
+ iso_bsize, NOCRED, &bp)) != 0)
goto out;
vdp = (struct iso_volume_descriptor *)bp->b_data;
@@ -414,10 +414,10 @@ iso_mountfs(devvp, mp, p, argp)
/* Check the Rock Ridge Extention support */
if (!(argp->flags & ISOFSMNT_NORRIP)) {
- if (error = bread(isomp->im_devvp,
+ if ((error = bread(isomp->im_devvp,
(isomp->root_extent + isonum_711(rootp->ext_attr_length)) <<
(isomp->im_bshift - DEV_BSHIFT),
- isomp->logical_block_size, NOCRED, &bp))
+ isomp->logical_block_size, NOCRED, &bp)) != 0)
goto out;
rootp = (struct iso_directory_record *)bp->b_data;
@@ -641,7 +641,7 @@ cd9660_fhtovp(mp, fhp, nam, vpp, exflagsp, credanonp)
if (np == NULL)
return (EACCES);
- if (error = VFS_VGET(mp, ifhp->ifid_ino, &nvp)) {
+ if ((error = VFS_VGET(mp, ifhp->ifid_ino, &nvp)) != 0) {
*vpp = NULLVP;
return (error);
}
@@ -700,7 +700,7 @@ cd9660_vget_internal(mp, ino, vpp, relocated, isodir)
return (0);
/* Allocate a new vnode/iso_node. */
- if (error = getnewvnode(VT_ISOFS, mp, cd9660_vnodeop_p, &vp)) {
+ if ((error = getnewvnode(VT_ISOFS, mp, cd9660_vnodeop_p, &vp)) != 0) {
*vpp = NULLVP;
return (error);
}
@@ -787,7 +787,7 @@ cd9660_vget_internal(mp, ino, vpp, relocated, isodir)
ip->iso_start = ino >> imp->im_bshift;
if (bp != 0)
brelse(bp);
- if (error = cd9660_blkatoff(vp, (off_t)0, NULL, &bp)) {
+ if ((error = cd9660_blkatoff(vp, (off_t)0, NULL, &bp)) != 0) {
vput(vp);
return (error);
}
@@ -840,7 +840,7 @@ cd9660_vget_internal(mp, ino, vpp, relocated, isodir)
* if device, look at device number table for translation
*/
vp->v_op = cd9660_specop_p;
- if (nvp = checkalias(vp, ip->inode.iso_rdev, mp)) {
+ if ((nvp = checkalias(vp, ip->inode.iso_rdev, mp)) != NULL) {
/*
* Discard unneeded vnode, but save its iso_node.
* Note that the lock is carried over in the iso_node
@@ -858,6 +858,8 @@ cd9660_vget_internal(mp, ino, vpp, relocated, isodir)
ip->i_vnode = vp;
}
break;
+ default:
+ break;
}
if (ip->iso_extent == imp->root_extent)
diff --git a/sys/fs/cd9660/cd9660_vnops.c b/sys/fs/cd9660/cd9660_vnops.c
index c016056..5ec970a 100644
--- a/sys/fs/cd9660/cd9660_vnops.c
+++ b/sys/fs/cd9660/cd9660_vnops.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)cd9660_vnops.c 8.19 (Berkeley) 5/27/95
- * $Id: cd9660_vnops.c,v 1.52 1998/03/06 09:46:14 msmith Exp $
+ * $Id: cd9660_vnops.c,v 1.53 1998/07/04 20:45:30 julian Exp $
*/
#include <sys/param.h>
@@ -109,6 +109,8 @@ cd9660_setattr(ap)
case VBLK:
case VSOCK:
case VFIFO:
+ case VNON:
+ case VBAD:
return (0);
}
}
@@ -148,6 +150,9 @@ cd9660_access(ap)
case VLNK:
case VREG:
return (EROFS);
+ /* NOT REACHED */
+ default:
+ break;
}
}
@@ -362,7 +367,7 @@ iso_uiodir(idp,dp,off)
--idp->ncookies;
}
- if (error = uiomove((caddr_t) dp,dp->d_reclen,idp->uio))
+ if ((error = uiomove((caddr_t) dp,dp->d_reclen,idp->uio)) != 0)
return (error);
idp->uio_off = off;
return (0);
@@ -396,12 +401,12 @@ assoc = (cl > 1) && (*cname == ASSOCCHAR);
if (sl != cl
|| bcmp(sname,cname,sl)) {
if (idp->assocent.d_namlen) {
- if (error = iso_uiodir(idp,&idp->assocent,idp->assocoff))
+ if ((error = iso_uiodir(idp,&idp->assocent,idp->assocoff)) != 0)
return (error);
idp->assocent.d_namlen = 0;
}
if (idp->saveent.d_namlen) {
- if (error = iso_uiodir(idp,&idp->saveent,idp->saveoff))
+ if ((error = iso_uiodir(idp,&idp->saveent,idp->saveoff)) != 0)
return (error);
idp->saveent.d_namlen = 0;
}
@@ -492,8 +497,8 @@ cd9660_readdir(ap)
if ((idp->curroff & bmask) == 0) {
if (bp != NULL)
brelse(bp);
- if (error =
- cd9660_blkatoff(vdp, (off_t)idp->curroff, NULL, &bp))
+ if ((error =
+ cd9660_blkatoff(vdp, (off_t)idp->curroff, NULL, &bp)) != 0)
break;
entryoffsetinblock = 0;
}
diff --git a/sys/gnu/ext2fs/ext2_alloc.c b/sys/gnu/ext2fs/ext2_alloc.c
index 0d4dfe3..7ea77c7 100644
--- a/sys/gnu/ext2fs/ext2_alloc.c
+++ b/sys/gnu/ext2fs/ext2_alloc.c
@@ -126,7 +126,7 @@ ext2_alloc(ip, lbn, bpref, size, cred, bnp)
fs->s_es->s_free_blocks_count < fs->s_es->s_r_blocks_count)
goto nospace;
#if QUOTA
- if (error = chkdq(ip, (long)btodb(size), cred, 0))
+ if ((error = chkdq(ip, (long)btodb(size), cred, 0)) != 0)
return (error);
#endif
if (bpref >= fs->s_es->s_blocks_count)
diff --git a/sys/gnu/ext2fs/ext2_balloc.c b/sys/gnu/ext2fs/ext2_balloc.c
index b2317a2..2b485c6 100644
--- a/sys/gnu/ext2fs/ext2_balloc.c
+++ b/sys/gnu/ext2fs/ext2_balloc.c
@@ -160,7 +160,7 @@ ext2_debug("ext2_balloc called (%d, %d, %d)\n",
* Determine the number of levels of indirection.
*/
pref = 0;
- if (error = ufs_getlbns(vp, bn, indirs, &num))
+ if ((error = ufs_getlbns(vp, bn, indirs, &num)) != 0)
return(error);
#if DIAGNOSTIC
if (num < 1)
@@ -189,8 +189,8 @@ ext2_debug("ext2_balloc called (%d, %d, %d)\n",
pref = ext2_blkpref(ip, lbn, indirs[0].in_off +
EXT2_NDIR_BLOCKS, &ip->i_db[0], 0);
#endif
- if (error = ext2_alloc(ip, lbn, pref, (int)fs->s_blocksize,
- cred, &newb))
+ if ((error = ext2_alloc(ip, lbn, pref, (int)fs->s_blocksize,
+ cred, &newb)) != 0)
return (error);
nb = newb;
bp = getblk(vp, indirs[1].in_lbn, fs->s_blocksize, 0, 0);
@@ -200,7 +200,7 @@ ext2_debug("ext2_balloc called (%d, %d, %d)\n",
* Write synchronously so that indirect blocks
* never point at garbage.
*/
- if (error = bwrite(bp)) {
+ if ((error = bwrite(bp)) != 0) {
ext2_blkfree(ip, nb, fs->s_blocksize);
return (error);
}
@@ -239,8 +239,8 @@ ext2_debug("ext2_balloc called (%d, %d, %d)\n",
#else
pref = ext2_blkpref(ip, lbn, 0, (daddr_t *)0, 0);
#endif
- if (error =
- ext2_alloc(ip, lbn, pref, (int)fs->s_blocksize, cred, &newb)) {
+ if ((error =
+ ext2_alloc(ip, lbn, pref, (int)fs->s_blocksize, cred, &newb)) != 0) {
brelse(bp);
return (error);
}
@@ -252,7 +252,7 @@ ext2_debug("ext2_balloc called (%d, %d, %d)\n",
* Write synchronously so that indirect blocks
* never point at garbage.
*/
- if (error = bwrite(nbp)) {
+ if ((error = bwrite(nbp)) != 0) {
ext2_blkfree(ip, nb, fs->s_blocksize);
brelse(bp);
return (error);
@@ -274,8 +274,8 @@ ext2_debug("ext2_balloc called (%d, %d, %d)\n",
if (nb == 0) {
pref = ext2_blkpref(ip, lbn, indirs[i].in_off, &bap[0],
bp->b_lblkno);
- if (error = ext2_alloc(ip,
- lbn, pref, (int)fs->s_blocksize, cred, &newb)) {
+ if ((error = ext2_alloc(ip,
+ lbn, pref, (int)fs->s_blocksize, cred, &newb)) != 0) {
brelse(bp);
return (error);
}
diff --git a/sys/gnu/ext2fs/ext2_inode.c b/sys/gnu/ext2fs/ext2_inode.c
index b287c16..657f699 100644
--- a/sys/gnu/ext2fs/ext2_inode.c
+++ b/sys/gnu/ext2fs/ext2_inode.c
@@ -97,9 +97,9 @@ ext2_update(vp, waitfor)
if (vp->v_mount->mnt_flag & MNT_RDONLY)
return (0);
fs = ip->i_e2fs;
- if (error = bread(ip->i_devvp,
+ if ((error = bread(ip->i_devvp,
fsbtodb(fs, ino_to_fsba(fs, ip->i_number)),
- (int)fs->s_blocksize, NOCRED, &bp)) {
+ (int)fs->s_blocksize, NOCRED, &bp)) != 0) {
brelse(bp);
return (error);
}
@@ -170,7 +170,7 @@ printf("ext2_truncate called %d to %d\n", VTOI(ovp)->i_number, length);
return (UFS_UPDATE(ovp, 0));
}
#if QUOTA
- if (error = getinoquota(oip))
+ if ((error = getinoquota(oip)) != 0)
return (error);
#endif
fs = oip->i_e2fs;
@@ -188,8 +188,8 @@ printf("ext2_truncate called %d to %d\n", VTOI(ovp)->i_number, length);
if (flags & IO_SYNC)
aflags |= B_SYNC;
vnode_pager_setsize(ovp, length);
- if (error = ext2_balloc(oip, lbn, offset + 1, cred, &bp,
- aflags))
+ if ((error = ext2_balloc(oip, lbn, offset + 1, cred, &bp,
+ aflags)) != 0)
return (error);
oip->i_size = length;
if (aflags & IO_SYNC)
@@ -215,8 +215,8 @@ printf("ext2_truncate called %d to %d\n", VTOI(ovp)->i_number, length);
aflags = B_CLRBUF;
if (flags & IO_SYNC)
aflags |= B_SYNC;
- if (error = ext2_balloc(oip, lbn, offset, cred, &bp,
- aflags))
+ if ((error = ext2_balloc(oip, lbn, offset, cred, &bp,
+ aflags)) != 0)
return (error);
oip->i_size = length;
size = blksize(fs, oip, lbn);
@@ -451,8 +451,8 @@ ext2_indirtrunc(ip, lbn, dbn, lastbn, level, countp)
if (nb == 0)
continue;
if (level > SINGLE) {
- if (error = ext2_indirtrunc(ip, nlbn,
- fsbtodb(fs, nb), (daddr_t)-1, level - 1, &blkcount))
+ if ((error = ext2_indirtrunc(ip, nlbn,
+ fsbtodb(fs, nb), (daddr_t)-1, level - 1, &blkcount)) != 0)
allerror = error;
blocksreleased += blkcount;
}
@@ -467,8 +467,8 @@ ext2_indirtrunc(ip, lbn, dbn, lastbn, level, countp)
last = lastbn % factor;
nb = bap[i];
if (nb != 0) {
- if (error = ext2_indirtrunc(ip, nlbn, fsbtodb(fs, nb),
- last, level - 1, &blkcount))
+ if ((error = ext2_indirtrunc(ip, nlbn, fsbtodb(fs, nb),
+ last, level - 1, &blkcount)) != 0)
allerror = error;
blocksreleased += blkcount;
}
diff --git a/sys/gnu/ext2fs/ext2_linux_balloc.c b/sys/gnu/ext2fs/ext2_linux_balloc.c
index 56ea652..ed653e8 100644
--- a/sys/gnu/ext2fs/ext2_linux_balloc.c
+++ b/sys/gnu/ext2fs/ext2_linux_balloc.c
@@ -61,8 +61,8 @@ static void read_block_bitmap (struct mount * mp,
int error;
gdp = get_group_desc (mp, block_group, NULL);
- if(error = bread (VFSTOUFS(mp)->um_devvp,
- fsbtodb(sb, gdp->bg_block_bitmap),sb->s_blocksize, NOCRED, &bh))
+ if ((error = bread (VFSTOUFS(mp)->um_devvp,
+ fsbtodb(sb, gdp->bg_block_bitmap),sb->s_blocksize, NOCRED, &bh)) != 0)
panic ( "read_block_bitmap: "
"Cannot read block bitmap - "
"block_group = %d, block_bitmap = %lu",
diff --git a/sys/gnu/ext2fs/ext2_linux_ialloc.c b/sys/gnu/ext2fs/ext2_linux_ialloc.c
index 4cfb6a7..fc78391 100644
--- a/sys/gnu/ext2fs/ext2_linux_ialloc.c
+++ b/sys/gnu/ext2fs/ext2_linux_ialloc.c
@@ -99,10 +99,10 @@ static void read_inode_bitmap (struct mount * mp,
int error;
gdp = get_group_desc (mp, block_group, NULL);
- if (error = bread (VFSTOUFS(mp)->um_devvp,
+ if ((error = bread (VFSTOUFS(mp)->um_devvp,
fsbtodb(sb, gdp->bg_inode_bitmap),
sb->s_blocksize,
- NOCRED, &bh))
+ NOCRED, &bh)) != 0)
panic ( "read_inode_bitmap:"
"Cannot read inode bitmap - "
"block_group = %lu, inode_bitmap = %lu",
diff --git a/sys/gnu/ext2fs/ext2_lookup.c b/sys/gnu/ext2fs/ext2_lookup.c
index c0debc2..8eb5ba8 100644
--- a/sys/gnu/ext2fs/ext2_lookup.c
+++ b/sys/gnu/ext2fs/ext2_lookup.c
@@ -362,8 +362,8 @@ searchloop:
if ((dp->i_offset & bmask) == 0) {
if (bp != NULL)
brelse(bp);
- if (error =
- UFS_BLKATOFF(vdp, (off_t)dp->i_offset, NULL, &bp))
+ if ((error =
+ UFS_BLKATOFF(vdp, (off_t)dp->i_offset, NULL, &bp)) != 0)
return (error);
entryoffsetinblock = 0;
}
@@ -473,7 +473,7 @@ searchloop:
* Access for write is interpreted as allowing
* creation of files in the directory.
*/
- if (error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_proc))
+ if ((error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_proc)) != 0)
return (error);
/*
* Return an indication of where the new directory
@@ -554,7 +554,7 @@ found:
/*
* Write access to directory required to delete files.
*/
- if (error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_proc))
+ if ((error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_proc)) != 0)
return (error);
/*
* Return pointer to current entry in dp->i_offset,
@@ -571,7 +571,7 @@ found:
*vpp = vdp;
return (0);
}
- if (error = VFS_VGET(vdp->v_mount, dp->i_ino, &tdp))
+ if ((error = VFS_VGET(vdp->v_mount, dp->i_ino, &tdp)) != 0)
return (error);
/*
* If directory is "sticky", then user must own
@@ -600,7 +600,7 @@ found:
*/
if (nameiop == RENAME && wantparent &&
(flags & ISLASTCN)) {
- if (error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_proc))
+ if ((error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_proc)) != 0)
return (error);
/*
* Careful about locking second inode.
@@ -608,7 +608,7 @@ found:
*/
if (dp->i_number == dp->i_ino)
return (EISDIR);
- if (error = VFS_VGET(vdp->v_mount, dp->i_ino, &tdp))
+ if ((error = VFS_VGET(vdp->v_mount, dp->i_ino, &tdp)) != 0)
return (error);
*vpp = tdp;
cnp->cn_flags |= SAVENAME;
@@ -639,7 +639,7 @@ found:
pdp = vdp;
if (flags & ISDOTDOT) {
VOP_UNLOCK(pdp, 0, p); /* race to get the inode */
- if (error = VFS_VGET(vdp->v_mount, dp->i_ino, &tdp)) {
+ if ((error = VFS_VGET(vdp->v_mount, dp->i_ino, &tdp)) != 0) {
vn_lock(pdp, LK_EXCLUSIVE | LK_RETRY, p);
return (error);
}
@@ -653,7 +653,7 @@ found:
VREF(vdp); /* we want ourself, ie "." */
*vpp = vdp;
} else {
- if (error = VFS_VGET(vdp->v_mount, dp->i_ino, &tdp))
+ if ((error = VFS_VGET(vdp->v_mount, dp->i_ino, &tdp)) != 0)
return (error);
if (!lockparent || !(flags & ISLASTCN))
VOP_UNLOCK(pdp, 0, p);
@@ -798,7 +798,7 @@ ext2_direnter(ip, dvp, cnp)
/*
* Get the block containing the space for the new directory entry.
*/
- if (error = UFS_BLKATOFF(dvp, (off_t)dp->i_offset, &dirbuf, &bp))
+ if ((error = UFS_BLKATOFF(dvp, (off_t)dp->i_offset, &dirbuf, &bp)) != 0)
return (error);
/*
* Find space for the new entry. In the simple case, the entry at
@@ -876,8 +876,8 @@ ext2_dirremove(dvp, cnp)
/*
* First entry in block: set d_ino to zero.
*/
- if (error =
- UFS_BLKATOFF(dvp, (off_t)dp->i_offset, (char **)&ep, &bp))
+ if ((error =
+ UFS_BLKATOFF(dvp, (off_t)dp->i_offset, (char **)&ep, &bp)) != 0)
return (error);
ep->inode = 0;
error = VOP_BWRITE(bp);
@@ -887,8 +887,8 @@ ext2_dirremove(dvp, cnp)
/*
* Collapse new free space into previous entry.
*/
- if (error = UFS_BLKATOFF(dvp, (off_t)(dp->i_offset - dp->i_count),
- (char **)&ep, &bp))
+ if ((error = UFS_BLKATOFF(dvp, (off_t)(dp->i_offset - dp->i_count),
+ (char **)&ep, &bp)) != 0)
return (error);
ep->rec_len += dp->i_reclen;
error = VOP_BWRITE(bp);
@@ -911,7 +911,7 @@ ext2_dirrewrite(dp, ip, cnp)
struct vnode *vdp = ITOV(dp);
int error;
- if (error = UFS_BLKATOFF(vdp, (off_t)dp->i_offset, (char **)&ep, &bp))
+ if ((error = UFS_BLKATOFF(vdp, (off_t)dp->i_offset, (char **)&ep, &bp)) != 0)
return (error);
ep->inode = ip->i_number;
error = VOP_BWRITE(bp);
@@ -1024,7 +1024,7 @@ ext2_checkpath(source, target, cred)
if (dirbuf.dotdot_ino == rootino)
break;
vput(vp);
- if (error = VFS_VGET(vp->v_mount, dirbuf.dotdot_ino, &vp)) {
+ if ((error = VFS_VGET(vp->v_mount, dirbuf.dotdot_ino, &vp)) != 0) {
vp = NULL;
break;
}
diff --git a/sys/gnu/ext2fs/ext2_subr.c b/sys/gnu/ext2fs/ext2_subr.c
index ed48acf..8ceac74 100644
--- a/sys/gnu/ext2fs/ext2_subr.c
+++ b/sys/gnu/ext2fs/ext2_subr.c
@@ -82,7 +82,7 @@ ext2_blkatoff(vp, offset, res, bpp)
bsize = blksize(fs, ip, lbn);
*bpp = NULL;
- if (error = bread(vp, lbn, bsize, NOCRED, &bp)) {
+ if ((error = bread(vp, lbn, bsize, NOCRED, &bp)) != 0) {
brelse(bp);
return (error);
}
diff --git a/sys/gnu/ext2fs/ext2_vfsops.c b/sys/gnu/ext2fs/ext2_vfsops.c
index ea756b5..f8403f5 100644
--- a/sys/gnu/ext2fs/ext2_vfsops.c
+++ b/sys/gnu/ext2fs/ext2_vfsops.c
@@ -189,7 +189,7 @@ ext2_mount(mp, path, data, ndp, p)
int error, flags;
mode_t accessmode;
- if (error = copyin(data, (caddr_t)&args, sizeof (struct ufs_args)))
+ if ((error = copyin(data, (caddr_t)&args, sizeof (struct ufs_args))) != 0)
return (error);
/*
* If updating, check whether changing from read-only to
@@ -231,8 +231,8 @@ ext2_mount(mp, path, data, ndp, p)
if (p->p_ucred->cr_uid != 0) {
devvp = ump->um_devvp;
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p);
- if (error = VOP_ACCESS(devvp, VREAD | VWRITE,
- p->p_ucred, p)) {
+ if ((error = VOP_ACCESS(devvp, VREAD | VWRITE,
+ p->p_ucred, p)) != 0) {
VOP_UNLOCK(devvp, 0, p);
return (error);
}
@@ -268,7 +268,7 @@ ext2_mount(mp, path, data, ndp, p)
* and verify that it refers to a sensible block device.
*/
NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, args.fspec, p);
- if (error = namei(ndp))
+ if ((error = namei(ndp)) != 0)
return (error);
devvp = ndp->ni_vp;
@@ -291,7 +291,7 @@ ext2_mount(mp, path, data, ndp, p)
if ((mp->mnt_flag & MNT_RDONLY) == 0)
accessmode |= VWRITE;
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p);
- if (error = VOP_ACCESS(devvp, accessmode, p->p_ucred, p)) {
+ if ((error = VOP_ACCESS(devvp, accessmode, p->p_ucred, p)) != 0) {
vput(devvp);
return (error);
}
@@ -518,7 +518,7 @@ ext2_reload(mountp, cred, p)
* Step 2: re-read superblock from disk.
* constants have been adjusted for ext2
*/
- if (error = bread(devvp, SBLOCK, SBSIZE, NOCRED, &bp))
+ if ((error = bread(devvp, SBLOCK, SBSIZE, NOCRED, &bp)) != 0)
return (error);
es = (struct ext2_super_block *)bp->b_data;
if (es->s_magic != EXT2_SUPER_MAGIC) {
@@ -535,7 +535,7 @@ ext2_reload(mountp, cred, p)
fs = VFSTOUFS(mountp)->um_e2fs;
bcopy(bp->b_data, fs->s_es, sizeof(struct ext2_super_block));
- if(error = compute_sb_data(devvp, es, fs)) {
+ if((error = compute_sb_data(devvp, es, fs)) != 0) {
brelse(bp);
return error;
}
@@ -615,11 +615,11 @@ ext2_mountfs(devvp, mp, p)
* (except for root, which might share swap device for miniroot).
* Flush out any old buffers remaining from a previous use.
*/
- if (error = vfs_mountedon(devvp))
+ if ((error = vfs_mountedon(devvp)) != 0)
return (error);
if (vcount(devvp) > 1 && devvp != rootvp)
return (EBUSY);
- if (error = vinvalbuf(devvp, V_SAVE, p->p_ucred, p, 0, 0))
+ if ((error = vinvalbuf(devvp, V_SAVE, p->p_ucred, p, 0, 0)) != 0)
return (error);
#ifdef READONLY
/* turn on this to force it to be read-only */
@@ -627,7 +627,7 @@ ext2_mountfs(devvp, mp, p)
#endif
ronly = (mp->mnt_flag & MNT_RDONLY) != 0;
- if (error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, p))
+ if ((error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, p)) != 0)
return (error);
if (VOP_IOCTL(devvp, DIOCGPART, (caddr_t)&dpart, FREAD, NOCRED, p) != 0)
size = DEV_BSIZE;
@@ -638,7 +638,7 @@ ext2_mountfs(devvp, mp, p)
bp = NULL;
ump = NULL;
- if (error = bread(devvp, SBLOCK, SBSIZE, NOCRED, &bp))
+ if ((error = bread(devvp, SBLOCK, SBSIZE, NOCRED, &bp)) != 0)
goto out;
es = (struct ext2_super_block *)bp->b_data;
if (es->s_magic != EXT2_SUPER_MAGIC) {
@@ -751,7 +751,7 @@ ext2_unmount(mp, mntflags, p)
return (EINVAL);
flags |= FORCECLOSE;
}
- if (error = ext2_flushfiles(mp, flags, p))
+ if ((error = ext2_flushfiles(mp, flags, p)) != 0)
return (error);
ump = VFSTOUFS(mp);
fs = ump->um_e2fs;
@@ -806,7 +806,7 @@ ext2_flushfiles(mp, flags, p)
ump = VFSTOUFS(mp);
#if QUOTA
if (mp->mnt_flag & MNT_QUOTA) {
- if (error = vflush(mp, NULLVP, SKIPSYSTEM|flags))
+ if ((error = vflush(mp, NULLVP, SKIPSYSTEM|flags)) != 0)
return (error);
for (i = 0; i < MAXQUOTAS; i++) {
if (ump->um_quotas[i] == NULLVP)
@@ -930,7 +930,7 @@ loop:
goto loop;
continue;
}
- if (error = VOP_FSYNC(vp, cred, waitfor, p))
+ if ((error = VOP_FSYNC(vp, cred, waitfor, p)) != 0)
allerror = error;
VOP_UNLOCK(vp, 0, p);
vrele(vp);
@@ -1012,7 +1012,7 @@ restart:
MALLOC(ip, struct inode *, sizeof(struct inode), M_EXT2NODE, M_WAITOK);
/* Allocate a new vnode/inode. */
- if (error = getnewvnode(VT_UFS, mp, ext2_vnodeop_p, &vp)) {
+ if ((error = getnewvnode(VT_UFS, mp, ext2_vnodeop_p, &vp)) != 0) {
if (ext2fs_inode_hash_lock < 0)
wakeup(&ext2fs_inode_hash_lock);
ext2fs_inode_hash_lock = 0;
@@ -1047,8 +1047,8 @@ restart:
#if 0
printf("ext2_vget(%d) dbn= %d ", ino, fsbtodb(fs, ino_to_fsba(fs, ino)));
#endif
- if (error = bread(ump->um_devvp, fsbtodb(fs, ino_to_fsba(fs, ino)),
- (int)fs->s_blocksize, NOCRED, &bp)) {
+ if ((error = bread(ump->um_devvp, fsbtodb(fs, ino_to_fsba(fs, ino)),
+ (int)fs->s_blocksize, NOCRED, &bp)) != 0) {
/*
* The inode does not contain anything useful, so it would
* be misleading to leave it on its hash chain. With mode
@@ -1086,7 +1086,7 @@ printf("ext2_vget(%d) dbn= %d ", ino, fsbtodb(fs, ino_to_fsba(fs, ino)));
* Initialize the vnode from the inode, check for aliases.
* Note that the underlying vnode may have changed.
*/
- if (error = ufs_vinit(mp, ext2_specop_p, ext2_fifoop_p, &vp)) {
+ if ((error = ufs_vinit(mp, ext2_specop_p, ext2_fifoop_p, &vp)) != 0) {
vput(vp);
*vpp = NULL;
return (error);
diff --git a/sys/gnu/ext2fs/ext2_vnops.c b/sys/gnu/ext2fs/ext2_vnops.c
index f3b9bcc..8463a30 100644
--- a/sys/gnu/ext2fs/ext2_vnops.c
+++ b/sys/gnu/ext2fs/ext2_vnops.c
@@ -478,7 +478,7 @@ abortit:
vput(fvp);
return (error);
}
- if (error = vn_lock(fvp, LK_EXCLUSIVE, p))
+ if ((error = vn_lock(fvp, LK_EXCLUSIVE, p)) != 0)
goto abortit;
dp = VTOI(fdvp);
ip = VTOI(fvp);
@@ -522,7 +522,7 @@ abortit:
*/
ip->i_nlink++;
ip->i_flag |= IN_CHANGE;
- if (error = UFS_UPDATE(fvp, 1)) {
+ if ((error = UFS_UPDATE(fvp, 1)) != 0) {
VOP_UNLOCK(fvp, 0, p);
goto bad;
}
diff --git a/sys/gnu/fs/ext2fs/ext2_alloc.c b/sys/gnu/fs/ext2fs/ext2_alloc.c
index 0d4dfe3..7ea77c7 100644
--- a/sys/gnu/fs/ext2fs/ext2_alloc.c
+++ b/sys/gnu/fs/ext2fs/ext2_alloc.c
@@ -126,7 +126,7 @@ ext2_alloc(ip, lbn, bpref, size, cred, bnp)
fs->s_es->s_free_blocks_count < fs->s_es->s_r_blocks_count)
goto nospace;
#if QUOTA
- if (error = chkdq(ip, (long)btodb(size), cred, 0))
+ if ((error = chkdq(ip, (long)btodb(size), cred, 0)) != 0)
return (error);
#endif
if (bpref >= fs->s_es->s_blocks_count)
diff --git a/sys/gnu/fs/ext2fs/ext2_balloc.c b/sys/gnu/fs/ext2fs/ext2_balloc.c
index b2317a2..2b485c6 100644
--- a/sys/gnu/fs/ext2fs/ext2_balloc.c
+++ b/sys/gnu/fs/ext2fs/ext2_balloc.c
@@ -160,7 +160,7 @@ ext2_debug("ext2_balloc called (%d, %d, %d)\n",
* Determine the number of levels of indirection.
*/
pref = 0;
- if (error = ufs_getlbns(vp, bn, indirs, &num))
+ if ((error = ufs_getlbns(vp, bn, indirs, &num)) != 0)
return(error);
#if DIAGNOSTIC
if (num < 1)
@@ -189,8 +189,8 @@ ext2_debug("ext2_balloc called (%d, %d, %d)\n",
pref = ext2_blkpref(ip, lbn, indirs[0].in_off +
EXT2_NDIR_BLOCKS, &ip->i_db[0], 0);
#endif
- if (error = ext2_alloc(ip, lbn, pref, (int)fs->s_blocksize,
- cred, &newb))
+ if ((error = ext2_alloc(ip, lbn, pref, (int)fs->s_blocksize,
+ cred, &newb)) != 0)
return (error);
nb = newb;
bp = getblk(vp, indirs[1].in_lbn, fs->s_blocksize, 0, 0);
@@ -200,7 +200,7 @@ ext2_debug("ext2_balloc called (%d, %d, %d)\n",
* Write synchronously so that indirect blocks
* never point at garbage.
*/
- if (error = bwrite(bp)) {
+ if ((error = bwrite(bp)) != 0) {
ext2_blkfree(ip, nb, fs->s_blocksize);
return (error);
}
@@ -239,8 +239,8 @@ ext2_debug("ext2_balloc called (%d, %d, %d)\n",
#else
pref = ext2_blkpref(ip, lbn, 0, (daddr_t *)0, 0);
#endif
- if (error =
- ext2_alloc(ip, lbn, pref, (int)fs->s_blocksize, cred, &newb)) {
+ if ((error =
+ ext2_alloc(ip, lbn, pref, (int)fs->s_blocksize, cred, &newb)) != 0) {
brelse(bp);
return (error);
}
@@ -252,7 +252,7 @@ ext2_debug("ext2_balloc called (%d, %d, %d)\n",
* Write synchronously so that indirect blocks
* never point at garbage.
*/
- if (error = bwrite(nbp)) {
+ if ((error = bwrite(nbp)) != 0) {
ext2_blkfree(ip, nb, fs->s_blocksize);
brelse(bp);
return (error);
@@ -274,8 +274,8 @@ ext2_debug("ext2_balloc called (%d, %d, %d)\n",
if (nb == 0) {
pref = ext2_blkpref(ip, lbn, indirs[i].in_off, &bap[0],
bp->b_lblkno);
- if (error = ext2_alloc(ip,
- lbn, pref, (int)fs->s_blocksize, cred, &newb)) {
+ if ((error = ext2_alloc(ip,
+ lbn, pref, (int)fs->s_blocksize, cred, &newb)) != 0) {
brelse(bp);
return (error);
}
diff --git a/sys/gnu/fs/ext2fs/ext2_inode.c b/sys/gnu/fs/ext2fs/ext2_inode.c
index b287c16..657f699 100644
--- a/sys/gnu/fs/ext2fs/ext2_inode.c
+++ b/sys/gnu/fs/ext2fs/ext2_inode.c
@@ -97,9 +97,9 @@ ext2_update(vp, waitfor)
if (vp->v_mount->mnt_flag & MNT_RDONLY)
return (0);
fs = ip->i_e2fs;
- if (error = bread(ip->i_devvp,
+ if ((error = bread(ip->i_devvp,
fsbtodb(fs, ino_to_fsba(fs, ip->i_number)),
- (int)fs->s_blocksize, NOCRED, &bp)) {
+ (int)fs->s_blocksize, NOCRED, &bp)) != 0) {
brelse(bp);
return (error);
}
@@ -170,7 +170,7 @@ printf("ext2_truncate called %d to %d\n", VTOI(ovp)->i_number, length);
return (UFS_UPDATE(ovp, 0));
}
#if QUOTA
- if (error = getinoquota(oip))
+ if ((error = getinoquota(oip)) != 0)
return (error);
#endif
fs = oip->i_e2fs;
@@ -188,8 +188,8 @@ printf("ext2_truncate called %d to %d\n", VTOI(ovp)->i_number, length);
if (flags & IO_SYNC)
aflags |= B_SYNC;
vnode_pager_setsize(ovp, length);
- if (error = ext2_balloc(oip, lbn, offset + 1, cred, &bp,
- aflags))
+ if ((error = ext2_balloc(oip, lbn, offset + 1, cred, &bp,
+ aflags)) != 0)
return (error);
oip->i_size = length;
if (aflags & IO_SYNC)
@@ -215,8 +215,8 @@ printf("ext2_truncate called %d to %d\n", VTOI(ovp)->i_number, length);
aflags = B_CLRBUF;
if (flags & IO_SYNC)
aflags |= B_SYNC;
- if (error = ext2_balloc(oip, lbn, offset, cred, &bp,
- aflags))
+ if ((error = ext2_balloc(oip, lbn, offset, cred, &bp,
+ aflags)) != 0)
return (error);
oip->i_size = length;
size = blksize(fs, oip, lbn);
@@ -451,8 +451,8 @@ ext2_indirtrunc(ip, lbn, dbn, lastbn, level, countp)
if (nb == 0)
continue;
if (level > SINGLE) {
- if (error = ext2_indirtrunc(ip, nlbn,
- fsbtodb(fs, nb), (daddr_t)-1, level - 1, &blkcount))
+ if ((error = ext2_indirtrunc(ip, nlbn,
+ fsbtodb(fs, nb), (daddr_t)-1, level - 1, &blkcount)) != 0)
allerror = error;
blocksreleased += blkcount;
}
@@ -467,8 +467,8 @@ ext2_indirtrunc(ip, lbn, dbn, lastbn, level, countp)
last = lastbn % factor;
nb = bap[i];
if (nb != 0) {
- if (error = ext2_indirtrunc(ip, nlbn, fsbtodb(fs, nb),
- last, level - 1, &blkcount))
+ if ((error = ext2_indirtrunc(ip, nlbn, fsbtodb(fs, nb),
+ last, level - 1, &blkcount)) != 0)
allerror = error;
blocksreleased += blkcount;
}
diff --git a/sys/gnu/fs/ext2fs/ext2_linux_balloc.c b/sys/gnu/fs/ext2fs/ext2_linux_balloc.c
index 56ea652..ed653e8 100644
--- a/sys/gnu/fs/ext2fs/ext2_linux_balloc.c
+++ b/sys/gnu/fs/ext2fs/ext2_linux_balloc.c
@@ -61,8 +61,8 @@ static void read_block_bitmap (struct mount * mp,
int error;
gdp = get_group_desc (mp, block_group, NULL);
- if(error = bread (VFSTOUFS(mp)->um_devvp,
- fsbtodb(sb, gdp->bg_block_bitmap),sb->s_blocksize, NOCRED, &bh))
+ if ((error = bread (VFSTOUFS(mp)->um_devvp,
+ fsbtodb(sb, gdp->bg_block_bitmap),sb->s_blocksize, NOCRED, &bh)) != 0)
panic ( "read_block_bitmap: "
"Cannot read block bitmap - "
"block_group = %d, block_bitmap = %lu",
diff --git a/sys/gnu/fs/ext2fs/ext2_linux_ialloc.c b/sys/gnu/fs/ext2fs/ext2_linux_ialloc.c
index 4cfb6a7..fc78391 100644
--- a/sys/gnu/fs/ext2fs/ext2_linux_ialloc.c
+++ b/sys/gnu/fs/ext2fs/ext2_linux_ialloc.c
@@ -99,10 +99,10 @@ static void read_inode_bitmap (struct mount * mp,
int error;
gdp = get_group_desc (mp, block_group, NULL);
- if (error = bread (VFSTOUFS(mp)->um_devvp,
+ if ((error = bread (VFSTOUFS(mp)->um_devvp,
fsbtodb(sb, gdp->bg_inode_bitmap),
sb->s_blocksize,
- NOCRED, &bh))
+ NOCRED, &bh)) != 0)
panic ( "read_inode_bitmap:"
"Cannot read inode bitmap - "
"block_group = %lu, inode_bitmap = %lu",
diff --git a/sys/gnu/fs/ext2fs/ext2_lookup.c b/sys/gnu/fs/ext2fs/ext2_lookup.c
index c0debc2..8eb5ba8 100644
--- a/sys/gnu/fs/ext2fs/ext2_lookup.c
+++ b/sys/gnu/fs/ext2fs/ext2_lookup.c
@@ -362,8 +362,8 @@ searchloop:
if ((dp->i_offset & bmask) == 0) {
if (bp != NULL)
brelse(bp);
- if (error =
- UFS_BLKATOFF(vdp, (off_t)dp->i_offset, NULL, &bp))
+ if ((error =
+ UFS_BLKATOFF(vdp, (off_t)dp->i_offset, NULL, &bp)) != 0)
return (error);
entryoffsetinblock = 0;
}
@@ -473,7 +473,7 @@ searchloop:
* Access for write is interpreted as allowing
* creation of files in the directory.
*/
- if (error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_proc))
+ if ((error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_proc)) != 0)
return (error);
/*
* Return an indication of where the new directory
@@ -554,7 +554,7 @@ found:
/*
* Write access to directory required to delete files.
*/
- if (error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_proc))
+ if ((error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_proc)) != 0)
return (error);
/*
* Return pointer to current entry in dp->i_offset,
@@ -571,7 +571,7 @@ found:
*vpp = vdp;
return (0);
}
- if (error = VFS_VGET(vdp->v_mount, dp->i_ino, &tdp))
+ if ((error = VFS_VGET(vdp->v_mount, dp->i_ino, &tdp)) != 0)
return (error);
/*
* If directory is "sticky", then user must own
@@ -600,7 +600,7 @@ found:
*/
if (nameiop == RENAME && wantparent &&
(flags & ISLASTCN)) {
- if (error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_proc))
+ if ((error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_proc)) != 0)
return (error);
/*
* Careful about locking second inode.
@@ -608,7 +608,7 @@ found:
*/
if (dp->i_number == dp->i_ino)
return (EISDIR);
- if (error = VFS_VGET(vdp->v_mount, dp->i_ino, &tdp))
+ if ((error = VFS_VGET(vdp->v_mount, dp->i_ino, &tdp)) != 0)
return (error);
*vpp = tdp;
cnp->cn_flags |= SAVENAME;
@@ -639,7 +639,7 @@ found:
pdp = vdp;
if (flags & ISDOTDOT) {
VOP_UNLOCK(pdp, 0, p); /* race to get the inode */
- if (error = VFS_VGET(vdp->v_mount, dp->i_ino, &tdp)) {
+ if ((error = VFS_VGET(vdp->v_mount, dp->i_ino, &tdp)) != 0) {
vn_lock(pdp, LK_EXCLUSIVE | LK_RETRY, p);
return (error);
}
@@ -653,7 +653,7 @@ found:
VREF(vdp); /* we want ourself, ie "." */
*vpp = vdp;
} else {
- if (error = VFS_VGET(vdp->v_mount, dp->i_ino, &tdp))
+ if ((error = VFS_VGET(vdp->v_mount, dp->i_ino, &tdp)) != 0)
return (error);
if (!lockparent || !(flags & ISLASTCN))
VOP_UNLOCK(pdp, 0, p);
@@ -798,7 +798,7 @@ ext2_direnter(ip, dvp, cnp)
/*
* Get the block containing the space for the new directory entry.
*/
- if (error = UFS_BLKATOFF(dvp, (off_t)dp->i_offset, &dirbuf, &bp))
+ if ((error = UFS_BLKATOFF(dvp, (off_t)dp->i_offset, &dirbuf, &bp)) != 0)
return (error);
/*
* Find space for the new entry. In the simple case, the entry at
@@ -876,8 +876,8 @@ ext2_dirremove(dvp, cnp)
/*
* First entry in block: set d_ino to zero.
*/
- if (error =
- UFS_BLKATOFF(dvp, (off_t)dp->i_offset, (char **)&ep, &bp))
+ if ((error =
+ UFS_BLKATOFF(dvp, (off_t)dp->i_offset, (char **)&ep, &bp)) != 0)
return (error);
ep->inode = 0;
error = VOP_BWRITE(bp);
@@ -887,8 +887,8 @@ ext2_dirremove(dvp, cnp)
/*
* Collapse new free space into previous entry.
*/
- if (error = UFS_BLKATOFF(dvp, (off_t)(dp->i_offset - dp->i_count),
- (char **)&ep, &bp))
+ if ((error = UFS_BLKATOFF(dvp, (off_t)(dp->i_offset - dp->i_count),
+ (char **)&ep, &bp)) != 0)
return (error);
ep->rec_len += dp->i_reclen;
error = VOP_BWRITE(bp);
@@ -911,7 +911,7 @@ ext2_dirrewrite(dp, ip, cnp)
struct vnode *vdp = ITOV(dp);
int error;
- if (error = UFS_BLKATOFF(vdp, (off_t)dp->i_offset, (char **)&ep, &bp))
+ if ((error = UFS_BLKATOFF(vdp, (off_t)dp->i_offset, (char **)&ep, &bp)) != 0)
return (error);
ep->inode = ip->i_number;
error = VOP_BWRITE(bp);
@@ -1024,7 +1024,7 @@ ext2_checkpath(source, target, cred)
if (dirbuf.dotdot_ino == rootino)
break;
vput(vp);
- if (error = VFS_VGET(vp->v_mount, dirbuf.dotdot_ino, &vp)) {
+ if ((error = VFS_VGET(vp->v_mount, dirbuf.dotdot_ino, &vp)) != 0) {
vp = NULL;
break;
}
diff --git a/sys/gnu/fs/ext2fs/ext2_subr.c b/sys/gnu/fs/ext2fs/ext2_subr.c
index ed48acf..8ceac74 100644
--- a/sys/gnu/fs/ext2fs/ext2_subr.c
+++ b/sys/gnu/fs/ext2fs/ext2_subr.c
@@ -82,7 +82,7 @@ ext2_blkatoff(vp, offset, res, bpp)
bsize = blksize(fs, ip, lbn);
*bpp = NULL;
- if (error = bread(vp, lbn, bsize, NOCRED, &bp)) {
+ if ((error = bread(vp, lbn, bsize, NOCRED, &bp)) != 0) {
brelse(bp);
return (error);
}
diff --git a/sys/gnu/fs/ext2fs/ext2_vfsops.c b/sys/gnu/fs/ext2fs/ext2_vfsops.c
index ea756b5..f8403f5 100644
--- a/sys/gnu/fs/ext2fs/ext2_vfsops.c
+++ b/sys/gnu/fs/ext2fs/ext2_vfsops.c
@@ -189,7 +189,7 @@ ext2_mount(mp, path, data, ndp, p)
int error, flags;
mode_t accessmode;
- if (error = copyin(data, (caddr_t)&args, sizeof (struct ufs_args)))
+ if ((error = copyin(data, (caddr_t)&args, sizeof (struct ufs_args))) != 0)
return (error);
/*
* If updating, check whether changing from read-only to
@@ -231,8 +231,8 @@ ext2_mount(mp, path, data, ndp, p)
if (p->p_ucred->cr_uid != 0) {
devvp = ump->um_devvp;
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p);
- if (error = VOP_ACCESS(devvp, VREAD | VWRITE,
- p->p_ucred, p)) {
+ if ((error = VOP_ACCESS(devvp, VREAD | VWRITE,
+ p->p_ucred, p)) != 0) {
VOP_UNLOCK(devvp, 0, p);
return (error);
}
@@ -268,7 +268,7 @@ ext2_mount(mp, path, data, ndp, p)
* and verify that it refers to a sensible block device.
*/
NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, args.fspec, p);
- if (error = namei(ndp))
+ if ((error = namei(ndp)) != 0)
return (error);
devvp = ndp->ni_vp;
@@ -291,7 +291,7 @@ ext2_mount(mp, path, data, ndp, p)
if ((mp->mnt_flag & MNT_RDONLY) == 0)
accessmode |= VWRITE;
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p);
- if (error = VOP_ACCESS(devvp, accessmode, p->p_ucred, p)) {
+ if ((error = VOP_ACCESS(devvp, accessmode, p->p_ucred, p)) != 0) {
vput(devvp);
return (error);
}
@@ -518,7 +518,7 @@ ext2_reload(mountp, cred, p)
* Step 2: re-read superblock from disk.
* constants have been adjusted for ext2
*/
- if (error = bread(devvp, SBLOCK, SBSIZE, NOCRED, &bp))
+ if ((error = bread(devvp, SBLOCK, SBSIZE, NOCRED, &bp)) != 0)
return (error);
es = (struct ext2_super_block *)bp->b_data;
if (es->s_magic != EXT2_SUPER_MAGIC) {
@@ -535,7 +535,7 @@ ext2_reload(mountp, cred, p)
fs = VFSTOUFS(mountp)->um_e2fs;
bcopy(bp->b_data, fs->s_es, sizeof(struct ext2_super_block));
- if(error = compute_sb_data(devvp, es, fs)) {
+ if((error = compute_sb_data(devvp, es, fs)) != 0) {
brelse(bp);
return error;
}
@@ -615,11 +615,11 @@ ext2_mountfs(devvp, mp, p)
* (except for root, which might share swap device for miniroot).
* Flush out any old buffers remaining from a previous use.
*/
- if (error = vfs_mountedon(devvp))
+ if ((error = vfs_mountedon(devvp)) != 0)
return (error);
if (vcount(devvp) > 1 && devvp != rootvp)
return (EBUSY);
- if (error = vinvalbuf(devvp, V_SAVE, p->p_ucred, p, 0, 0))
+ if ((error = vinvalbuf(devvp, V_SAVE, p->p_ucred, p, 0, 0)) != 0)
return (error);
#ifdef READONLY
/* turn on this to force it to be read-only */
@@ -627,7 +627,7 @@ ext2_mountfs(devvp, mp, p)
#endif
ronly = (mp->mnt_flag & MNT_RDONLY) != 0;
- if (error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, p))
+ if ((error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, p)) != 0)
return (error);
if (VOP_IOCTL(devvp, DIOCGPART, (caddr_t)&dpart, FREAD, NOCRED, p) != 0)
size = DEV_BSIZE;
@@ -638,7 +638,7 @@ ext2_mountfs(devvp, mp, p)
bp = NULL;
ump = NULL;
- if (error = bread(devvp, SBLOCK, SBSIZE, NOCRED, &bp))
+ if ((error = bread(devvp, SBLOCK, SBSIZE, NOCRED, &bp)) != 0)
goto out;
es = (struct ext2_super_block *)bp->b_data;
if (es->s_magic != EXT2_SUPER_MAGIC) {
@@ -751,7 +751,7 @@ ext2_unmount(mp, mntflags, p)
return (EINVAL);
flags |= FORCECLOSE;
}
- if (error = ext2_flushfiles(mp, flags, p))
+ if ((error = ext2_flushfiles(mp, flags, p)) != 0)
return (error);
ump = VFSTOUFS(mp);
fs = ump->um_e2fs;
@@ -806,7 +806,7 @@ ext2_flushfiles(mp, flags, p)
ump = VFSTOUFS(mp);
#if QUOTA
if (mp->mnt_flag & MNT_QUOTA) {
- if (error = vflush(mp, NULLVP, SKIPSYSTEM|flags))
+ if ((error = vflush(mp, NULLVP, SKIPSYSTEM|flags)) != 0)
return (error);
for (i = 0; i < MAXQUOTAS; i++) {
if (ump->um_quotas[i] == NULLVP)
@@ -930,7 +930,7 @@ loop:
goto loop;
continue;
}
- if (error = VOP_FSYNC(vp, cred, waitfor, p))
+ if ((error = VOP_FSYNC(vp, cred, waitfor, p)) != 0)
allerror = error;
VOP_UNLOCK(vp, 0, p);
vrele(vp);
@@ -1012,7 +1012,7 @@ restart:
MALLOC(ip, struct inode *, sizeof(struct inode), M_EXT2NODE, M_WAITOK);
/* Allocate a new vnode/inode. */
- if (error = getnewvnode(VT_UFS, mp, ext2_vnodeop_p, &vp)) {
+ if ((error = getnewvnode(VT_UFS, mp, ext2_vnodeop_p, &vp)) != 0) {
if (ext2fs_inode_hash_lock < 0)
wakeup(&ext2fs_inode_hash_lock);
ext2fs_inode_hash_lock = 0;
@@ -1047,8 +1047,8 @@ restart:
#if 0
printf("ext2_vget(%d) dbn= %d ", ino, fsbtodb(fs, ino_to_fsba(fs, ino)));
#endif
- if (error = bread(ump->um_devvp, fsbtodb(fs, ino_to_fsba(fs, ino)),
- (int)fs->s_blocksize, NOCRED, &bp)) {
+ if ((error = bread(ump->um_devvp, fsbtodb(fs, ino_to_fsba(fs, ino)),
+ (int)fs->s_blocksize, NOCRED, &bp)) != 0) {
/*
* The inode does not contain anything useful, so it would
* be misleading to leave it on its hash chain. With mode
@@ -1086,7 +1086,7 @@ printf("ext2_vget(%d) dbn= %d ", ino, fsbtodb(fs, ino_to_fsba(fs, ino)));
* Initialize the vnode from the inode, check for aliases.
* Note that the underlying vnode may have changed.
*/
- if (error = ufs_vinit(mp, ext2_specop_p, ext2_fifoop_p, &vp)) {
+ if ((error = ufs_vinit(mp, ext2_specop_p, ext2_fifoop_p, &vp)) != 0) {
vput(vp);
*vpp = NULL;
return (error);
diff --git a/sys/gnu/fs/ext2fs/ext2_vnops.c b/sys/gnu/fs/ext2fs/ext2_vnops.c
index f3b9bcc..8463a30 100644
--- a/sys/gnu/fs/ext2fs/ext2_vnops.c
+++ b/sys/gnu/fs/ext2fs/ext2_vnops.c
@@ -478,7 +478,7 @@ abortit:
vput(fvp);
return (error);
}
- if (error = vn_lock(fvp, LK_EXCLUSIVE, p))
+ if ((error = vn_lock(fvp, LK_EXCLUSIVE, p)) != 0)
goto abortit;
dp = VTOI(fdvp);
ip = VTOI(fvp);
@@ -522,7 +522,7 @@ abortit:
*/
ip->i_nlink++;
ip->i_flag |= IN_CHANGE;
- if (error = UFS_UPDATE(fvp, 1)) {
+ if ((error = UFS_UPDATE(fvp, 1)) != 0) {
VOP_UNLOCK(fvp, 0, p);
goto bad;
}
diff --git a/sys/isofs/cd9660/cd9660_lookup.c b/sys/isofs/cd9660/cd9660_lookup.c
index 2f7baef..3d0ff74 100644
--- a/sys/isofs/cd9660/cd9660_lookup.c
+++ b/sys/isofs/cd9660/cd9660_lookup.c
@@ -38,7 +38,7 @@
* from: @(#)ufs_lookup.c 7.33 (Berkeley) 5/19/91
*
* @(#)cd9660_lookup.c 8.2 (Berkeley) 1/23/94
- * $Id: cd9660_lookup.c,v 1.19 1997/10/16 10:47:33 phk Exp $
+ * $Id: cd9660_lookup.c,v 1.20 1997/11/07 08:52:50 phk Exp $
*/
#include <sys/param.h>
@@ -181,8 +181,8 @@ searchloop:
if ((dp->i_offset & bmask) == 0) {
if (bp != NULL)
brelse(bp);
- if (error =
- cd9660_blkatoff(vdp, (off_t)dp->i_offset, NULL, &bp))
+ if ((error =
+ cd9660_blkatoff(vdp, (off_t)dp->i_offset, NULL, &bp)) != 0)
return (error);
entryoffsetinblock = 0;
}
@@ -279,8 +279,8 @@ foundino:
lblkno(imp, saveoffset)) {
if (bp != NULL)
brelse(bp);
- if (error = cd9660_blkatoff(vdp,
- (off_t)saveoffset, NULL, &bp))
+ if ((error = cd9660_blkatoff(vdp,
+ (off_t)saveoffset, NULL, &bp)) != 0)
return (error);
}
entryoffsetinblock = saveoffset & bmask;
@@ -410,7 +410,7 @@ cd9660_blkatoff(vp, offset, res, bpp)
lbn = lblkno(imp, offset);
bsize = blksize(imp, ip, lbn);
- if (error = bread(vp, lbn, bsize, NOCRED, &bp)) {
+ if ((error = bread(vp, lbn, bsize, NOCRED, &bp)) != 0) {
brelse(bp);
*bpp = NULL;
return (error);
diff --git a/sys/isofs/cd9660/cd9660_node.c b/sys/isofs/cd9660/cd9660_node.c
index edfd66c..9640d6e 100644
--- a/sys/isofs/cd9660/cd9660_node.c
+++ b/sys/isofs/cd9660/cd9660_node.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)cd9660_node.c 8.2 (Berkeley) 1/23/94
- * $Id: cd9660_node.c,v 1.25 1998/02/09 06:09:18 eivind Exp $
+ * $Id: cd9660_node.c,v 1.26 1999/01/02 11:34:54 bde Exp $
*/
#include <sys/param.h>
@@ -120,7 +120,7 @@ cd9660_ihashins(ip)
simple_lock(&cd9660_ihash_slock);
ipp = &isohashtbl[INOHASH(ip->i_dev, ip->i_number)];
- if (iq = *ipp)
+ if ((iq = *ipp) != NULL)
iq->i_prev = &ip->i_next;
ip->i_next = iq;
ip->i_prev = ipp;
@@ -140,7 +140,7 @@ cd9660_ihashrem(ip)
register struct iso_node *iq;
simple_lock(&cd9660_ihash_slock);
- if (iq = ip->i_next)
+ if ((iq = ip->i_next) != NULL)
iq->i_prev = ip->i_prev;
*ip->i_prev = iq;
#ifdef DIAGNOSTIC
diff --git a/sys/isofs/cd9660/cd9660_vfsops.c b/sys/isofs/cd9660/cd9660_vfsops.c
index 9e661a6..9560c3f 100644
--- a/sys/isofs/cd9660/cd9660_vfsops.c
+++ b/sys/isofs/cd9660/cd9660_vfsops.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)cd9660_vfsops.c 8.18 (Berkeley) 5/22/95
- * $Id: cd9660_vfsops.c,v 1.46 1998/12/06 11:36:24 jkh Exp $
+ * $Id: cd9660_vfsops.c,v 1.47 1999/01/17 20:41:02 peter Exp $
*/
#include <sys/param.h>
@@ -239,7 +239,7 @@ cd9660_mount(mp, path, data, ndp, p)
if ((mp->mnt_flag & MNT_RDONLY) == 0)
accessmode |= VWRITE;
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p);
- if (error = VOP_ACCESS(devvp, accessmode, p->p_ucred, p)) {
+ if ((error = VOP_ACCESS(devvp, accessmode, p->p_ucred, p)) != 0) {
vput(devvp);
return (error);
}
@@ -324,8 +324,8 @@ iso_mountfs(devvp, mp, p, argp)
for (iso_blknum = 16 + argp->ssector;
iso_blknum < 100 + argp->ssector;
iso_blknum++) {
- if (error = bread(devvp, iso_blknum * btodb(iso_bsize),
- iso_bsize, NOCRED, &bp))
+ if ((error = bread(devvp, iso_blknum * btodb(iso_bsize),
+ iso_bsize, NOCRED, &bp)) != 0)
goto out;
vdp = (struct iso_volume_descriptor *)bp->b_data;
@@ -414,10 +414,10 @@ iso_mountfs(devvp, mp, p, argp)
/* Check the Rock Ridge Extention support */
if (!(argp->flags & ISOFSMNT_NORRIP)) {
- if (error = bread(isomp->im_devvp,
+ if ((error = bread(isomp->im_devvp,
(isomp->root_extent + isonum_711(rootp->ext_attr_length)) <<
(isomp->im_bshift - DEV_BSHIFT),
- isomp->logical_block_size, NOCRED, &bp))
+ isomp->logical_block_size, NOCRED, &bp)) != 0)
goto out;
rootp = (struct iso_directory_record *)bp->b_data;
@@ -641,7 +641,7 @@ cd9660_fhtovp(mp, fhp, nam, vpp, exflagsp, credanonp)
if (np == NULL)
return (EACCES);
- if (error = VFS_VGET(mp, ifhp->ifid_ino, &nvp)) {
+ if ((error = VFS_VGET(mp, ifhp->ifid_ino, &nvp)) != 0) {
*vpp = NULLVP;
return (error);
}
@@ -700,7 +700,7 @@ cd9660_vget_internal(mp, ino, vpp, relocated, isodir)
return (0);
/* Allocate a new vnode/iso_node. */
- if (error = getnewvnode(VT_ISOFS, mp, cd9660_vnodeop_p, &vp)) {
+ if ((error = getnewvnode(VT_ISOFS, mp, cd9660_vnodeop_p, &vp)) != 0) {
*vpp = NULLVP;
return (error);
}
@@ -787,7 +787,7 @@ cd9660_vget_internal(mp, ino, vpp, relocated, isodir)
ip->iso_start = ino >> imp->im_bshift;
if (bp != 0)
brelse(bp);
- if (error = cd9660_blkatoff(vp, (off_t)0, NULL, &bp)) {
+ if ((error = cd9660_blkatoff(vp, (off_t)0, NULL, &bp)) != 0) {
vput(vp);
return (error);
}
@@ -840,7 +840,7 @@ cd9660_vget_internal(mp, ino, vpp, relocated, isodir)
* if device, look at device number table for translation
*/
vp->v_op = cd9660_specop_p;
- if (nvp = checkalias(vp, ip->inode.iso_rdev, mp)) {
+ if ((nvp = checkalias(vp, ip->inode.iso_rdev, mp)) != NULL) {
/*
* Discard unneeded vnode, but save its iso_node.
* Note that the lock is carried over in the iso_node
@@ -858,6 +858,8 @@ cd9660_vget_internal(mp, ino, vpp, relocated, isodir)
ip->i_vnode = vp;
}
break;
+ default:
+ break;
}
if (ip->iso_extent == imp->root_extent)
diff --git a/sys/isofs/cd9660/cd9660_vnops.c b/sys/isofs/cd9660/cd9660_vnops.c
index c016056..5ec970a 100644
--- a/sys/isofs/cd9660/cd9660_vnops.c
+++ b/sys/isofs/cd9660/cd9660_vnops.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)cd9660_vnops.c 8.19 (Berkeley) 5/27/95
- * $Id: cd9660_vnops.c,v 1.52 1998/03/06 09:46:14 msmith Exp $
+ * $Id: cd9660_vnops.c,v 1.53 1998/07/04 20:45:30 julian Exp $
*/
#include <sys/param.h>
@@ -109,6 +109,8 @@ cd9660_setattr(ap)
case VBLK:
case VSOCK:
case VFIFO:
+ case VNON:
+ case VBAD:
return (0);
}
}
@@ -148,6 +150,9 @@ cd9660_access(ap)
case VLNK:
case VREG:
return (EROFS);
+ /* NOT REACHED */
+ default:
+ break;
}
}
@@ -362,7 +367,7 @@ iso_uiodir(idp,dp,off)
--idp->ncookies;
}
- if (error = uiomove((caddr_t) dp,dp->d_reclen,idp->uio))
+ if ((error = uiomove((caddr_t) dp,dp->d_reclen,idp->uio)) != 0)
return (error);
idp->uio_off = off;
return (0);
@@ -396,12 +401,12 @@ assoc = (cl > 1) && (*cname == ASSOCCHAR);
if (sl != cl
|| bcmp(sname,cname,sl)) {
if (idp->assocent.d_namlen) {
- if (error = iso_uiodir(idp,&idp->assocent,idp->assocoff))
+ if ((error = iso_uiodir(idp,&idp->assocent,idp->assocoff)) != 0)
return (error);
idp->assocent.d_namlen = 0;
}
if (idp->saveent.d_namlen) {
- if (error = iso_uiodir(idp,&idp->saveent,idp->saveoff))
+ if ((error = iso_uiodir(idp,&idp->saveent,idp->saveoff)) != 0)
return (error);
idp->saveent.d_namlen = 0;
}
@@ -492,8 +497,8 @@ cd9660_readdir(ap)
if ((idp->curroff & bmask) == 0) {
if (bp != NULL)
brelse(bp);
- if (error =
- cd9660_blkatoff(vdp, (off_t)idp->curroff, NULL, &bp))
+ if ((error =
+ cd9660_blkatoff(vdp, (off_t)idp->curroff, NULL, &bp)) != 0)
break;
entryoffsetinblock = 0;
}
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c
index 56f9d62..a719abb 100644
--- a/sys/kern/imgact_elf.c
+++ b/sys/kern/imgact_elf.c
@@ -26,7 +26,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: imgact_elf.c,v 1.44 1998/12/19 02:55:33 julian Exp $
+ * $Id: imgact_elf.c,v 1.45 1999/01/26 02:38:10 julian Exp $
*/
#include "opt_rlimit.h"
@@ -279,8 +279,8 @@ elf_load_section(struct proc *p, struct vmspace *vmspace, struct vnode *vp, vm_o
static int
elf_load_file(struct proc *p, char *file, u_long *addr, u_long *entry)
{
- Elf_Ehdr *hdr = NULL;
- Elf_Phdr *phdr = NULL;
+ const Elf_Ehdr *hdr = NULL;
+ const Elf_Phdr *phdr = NULL;
struct nameidata nd;
struct vmspace *vmspace = p->p_vmspace;
struct vattr attr;
@@ -308,7 +308,7 @@ elf_load_file(struct proc *p, char *file, u_long *addr, u_long *entry)
NDINIT(&nd, LOOKUP, LOCKLEAF|FOLLOW, UIO_SYSSPACE, file, p);
- if (error = namei(&nd)) {
+ if ((error = namei(&nd)) != 0) {
nd.ni_vp = NULL;
goto fail;
}
@@ -329,8 +329,8 @@ elf_load_file(struct proc *p, char *file, u_long *addr, u_long *entry)
if (error)
goto fail;
- hdr = (Elf_Ehdr *)imgp->image_header;
- if (error = elf_check_header(hdr, ET_DYN))
+ hdr = (const Elf_Ehdr *)imgp->image_header;
+ if ((error = elf_check_header(hdr, ET_DYN)) != 0)
goto fail;
/* Only support headers that fit within first page for now */
@@ -340,7 +340,7 @@ elf_load_file(struct proc *p, char *file, u_long *addr, u_long *entry)
goto fail;
}
- phdr = (Elf_Phdr *)(imgp->image_header + hdr->e_phoff);
+ phdr = (const Elf_Phdr *)(imgp->image_header + hdr->e_phoff);
for (i = 0; i < hdr->e_phnum; i++) {
if (phdr[i].p_type == PT_LOAD) { /* Loadable segment */
@@ -352,12 +352,12 @@ elf_load_file(struct proc *p, char *file, u_long *addr, u_long *entry)
if (phdr[i].p_flags & PF_R)
prot |= VM_PROT_READ;
- if (error = elf_load_section(p, vmspace, nd.ni_vp,
+ if ((error = elf_load_section(p, vmspace, nd.ni_vp,
phdr[i].p_offset,
(caddr_t)phdr[i].p_vaddr +
(*addr),
phdr[i].p_memsz,
- phdr[i].p_filesz, prot))
+ phdr[i].p_filesz, prot)) != 0)
goto fail;
/*
@@ -407,7 +407,7 @@ exec_elf_imgact(struct image_params *imgp)
int error, i;
const char *interp = NULL;
Elf_Brandinfo *brand_info;
- char *brand;
+ const char *brand;
char path[MAXPATHLEN];
/*
@@ -431,7 +431,7 @@ exec_elf_imgact(struct image_params *imgp)
/*
* From this point on, we may have resources that need to be freed.
*/
- if (error = exec_extract_strings(imgp))
+ if ((error = exec_extract_strings(imgp)) != 0)
goto fail;
exec_new_vmspace(imgp);
@@ -450,12 +450,12 @@ exec_elf_imgact(struct image_params *imgp)
if (phdr[i].p_flags & PF_R)
prot |= VM_PROT_READ;
- if (error = elf_load_section(imgp->proc,
+ if ((error = elf_load_section(imgp->proc,
vmspace, imgp->vp,
phdr[i].p_offset,
(caddr_t)phdr[i].p_vaddr,
phdr[i].p_memsz,
- phdr[i].p_filesz, prot))
+ phdr[i].p_filesz, prot)) != 0)
goto fail;
/*
@@ -504,7 +504,7 @@ exec_elf_imgact(struct image_params *imgp)
/* If the executable has a brand, search for it in the brand list. */
brand_info = NULL;
- brand = (char *)&hdr->e_ident[EI_BRAND];
+ brand = (const char *)&hdr->e_ident[EI_BRAND];
if (brand[0] != '\0') {
for (i = 0; i < MAX_BRANDS; i++) {
Elf_Brandinfo *bi = elf_brand_list[i];
diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c
index df832f6..e47459b 100644
--- a/sys/kern/kern_conf.c
+++ b/sys/kern/kern_conf.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: kern_conf.c,v 1.28 1998/10/25 17:44:50 phk Exp $
+ * $Id: kern_conf.c,v 1.29 1998/11/14 21:58:51 wollman Exp $
*/
#include <sys/param.h>
@@ -59,7 +59,7 @@ chrtoblk(dev_t dev)
{
struct cdevsw *cd;
- if(cd = cdevsw[major(dev)]) {
+ if((cd = cdevsw[major(dev)]) != NULL) {
if (cd->d_bmaj != -1)
return(makedev(cd->d_bmaj,minor(dev)));
}
@@ -173,12 +173,12 @@ cdevsw_module_handler(module_t mod, int what, void *arg)
switch (what) {
case MOD_LOAD:
- if (error = cdevsw_add(&data->dev, data->cdevsw, NULL))
+ if ((error = cdevsw_add(&data->dev, data->cdevsw, NULL)) != 0)
return error;
break;
case MOD_UNLOAD:
- if (error = cdevsw_add(&data->dev, NULL, NULL))
+ if ((error = cdevsw_add(&data->dev, NULL, NULL)) != 0)
return error;
break;
}
@@ -197,18 +197,18 @@ bdevsw_module_handler(module_t mod, int what, void* arg)
switch (what) {
case MOD_LOAD:
- if (error = cdevsw_add(&data->cdev, data->cdevsw, NULL))
+ if ((error = cdevsw_add(&data->cdev, data->cdevsw, NULL)) != 0)
return error;
- if (error = bdevsw_add(&data->bdev, data->cdevsw, NULL)) {
+ if ((error = bdevsw_add(&data->bdev, data->cdevsw, NULL)) != 0) {
cdevsw_add(&data->bdev, NULL, NULL);
return error;
}
break;
case MOD_UNLOAD:
- if (error = bdevsw_add(&data->bdev, NULL, NULL))
+ if ((error = bdevsw_add(&data->bdev, NULL, NULL)) != 0)
return error;
- if (error = cdevsw_add(&data->cdev, NULL, NULL))
+ if ((error = cdevsw_add(&data->cdev, NULL, NULL)) != 0)
return error;
break;
}
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index dd63672..2f36848 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: kern_exec.c,v 1.92 1998/12/30 10:38:59 dfr Exp $
+ * $Id: kern_exec.c,v 1.93 1999/01/06 23:05:38 julian Exp $
*/
#include <sys/param.h>
@@ -367,7 +367,7 @@ exec_map_first_page(imgp)
if (initial_pagein > object->size)
initial_pagein = object->size;
for (i = 1; i < initial_pagein; i++) {
- if (ma[i] = vm_page_lookup(object, i)) {
+ if ((ma[i] = vm_page_lookup(object, i)) != NULL) {
if ((ma[i]->flags & PG_BUSY) || ma[i]->busy)
break;
if (ma[i]->valid)
diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c
index 2cd5142..6545741 100644
--- a/sys/kern/kern_linker.c
+++ b/sys/kern/kern_linker.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: kern_linker.c,v 1.22 1999/01/23 03:45:22 peter Exp $
+ * $Id: kern_linker.c,v 1.23 1999/01/25 08:42:24 dfr Exp $
*/
#include "opt_ddb.h"
@@ -394,7 +394,7 @@ linker_file_unload(linker_file_t file)
/*
* Give the module a chance to veto the unload.
*/
- if (error = module_unload(mod)) {
+ if ((error = module_unload(mod)) != 0) {
KLD_DPF(FILE, ("linker_file_unload: module %x vetoes unload\n",
mod));
lockmgr(&lock, LK_RELEASE, 0, curproc);
@@ -639,11 +639,11 @@ kldload(struct proc* p, struct kldload_args* uap)
if (securelevel > 0)
return EPERM;
- if (error = suser(p->p_ucred, &p->p_acflag))
+ if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
return error;
filename = malloc(MAXPATHLEN, M_TEMP, M_WAITOK);
- if (error = copyinstr(SCARG(uap, file), filename, MAXPATHLEN, NULL))
+ if ((error = copyinstr(SCARG(uap, file), filename, MAXPATHLEN, NULL)) != 0)
goto out;
/* Can't load more than one module with the same name */
@@ -655,7 +655,7 @@ kldload(struct proc* p, struct kldload_args* uap)
goto out;
}
- if (error = linker_load_file(filename, &lf))
+ if ((error = linker_load_file(filename, &lf)) != 0)
goto out;
lf->userrefs++;
@@ -676,7 +676,7 @@ kldunload(struct proc* p, struct kldunload_args* uap)
if (securelevel > 0)
return EPERM;
- if (error = suser(p->p_ucred, &p->p_acflag))
+ if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
return error;
lf = linker_find_file_by_id(SCARG(uap, fileid));
@@ -708,7 +708,7 @@ kldfind(struct proc* p, struct kldfind_args* uap)
p->p_retval[0] = -1;
filename = malloc(MAXPATHLEN, M_TEMP, M_WAITOK);
- if (error = copyinstr(SCARG(uap, file), filename, MAXPATHLEN, NULL))
+ if ((error = copyinstr(SCARG(uap, file), filename, MAXPATHLEN, NULL)) != 0)
goto out;
modulename = rindex(filename, '/');
@@ -773,7 +773,7 @@ kldstat(struct proc* p, struct kldstat_args* uap)
/*
* Check the version of the user's structure.
*/
- if (error = copyin(&stat->version, &version, sizeof(version)))
+ if ((error = copyin(&stat->version, &version, sizeof(version))) != 0)
goto out;
if (version != sizeof(struct kld_file_stat)) {
error = EINVAL;
@@ -783,15 +783,15 @@ kldstat(struct proc* p, struct kldstat_args* uap)
namelen = strlen(lf->filename) + 1;
if (namelen > MAXPATHLEN)
namelen = MAXPATHLEN;
- if (error = copyout(lf->filename, &stat->name[0], namelen))
+ if ((error = copyout(lf->filename, &stat->name[0], namelen)) != 0)
goto out;
- if (error = copyout(&lf->refs, &stat->refs, sizeof(int)))
+ if ((error = copyout(&lf->refs, &stat->refs, sizeof(int))) != 0)
goto out;
- if (error = copyout(&lf->id, &stat->id, sizeof(int)))
+ if ((error = copyout(&lf->id, &stat->id, sizeof(int))) != 0)
goto out;
- if (error = copyout(&lf->address, &stat->address, sizeof(caddr_t)))
+ if ((error = copyout(&lf->address, &stat->address, sizeof(caddr_t))) != 0)
goto out;
- if (error = copyout(&lf->size, &stat->size, sizeof(size_t)))
+ if ((error = copyout(&lf->size, &stat->size, sizeof(size_t))) != 0)
goto out;
p->p_retval[0] = 0;
@@ -828,7 +828,7 @@ kldsym(struct proc *p, struct kldsym_args *uap)
struct kld_sym_lookup lookup;
int error = 0;
- if (error = copyin(SCARG(uap, data), &lookup, sizeof(lookup)))
+ if ((error = copyin(SCARG(uap, data), &lookup, sizeof(lookup))) != 0)
goto out;
if (lookup.version != sizeof(lookup) || SCARG(uap, cmd) != KLDSYM_LOOKUP) {
error = EINVAL;
@@ -836,7 +836,7 @@ kldsym(struct proc *p, struct kldsym_args *uap)
}
symstr = malloc(MAXPATHLEN, M_TEMP, M_WAITOK);
- if (error = copyinstr(lookup.symname, symstr, MAXPATHLEN, NULL))
+ if ((error = copyinstr(lookup.symname, symstr, MAXPATHLEN, NULL)) != 0)
goto out;
if (SCARG(uap, fileid) != 0) {
diff --git a/sys/kern/kern_lkm.c b/sys/kern/kern_lkm.c
index e5ea629..74e8a7f 100644
--- a/sys/kern/kern_lkm.c
+++ b/sys/kern/kern_lkm.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: kern_lkm.c,v 1.59 1998/11/10 09:12:40 peter Exp $
+ * $Id: kern_lkm.c,v 1.60 1999/01/17 19:00:58 peter Exp $
*/
#include "opt_devfs.h"
@@ -574,7 +574,7 @@ _lkm_vfs(lkmtp, cmd)
return(EEXIST);
for(i = 0; args->lkm_vnodeops->ls_items[i]; i++)
- vfs_add_vnodeops((void*)args->lkm_vnodeops->ls_items[i]);
+ vfs_add_vnodeops((const void*)args->lkm_vnodeops->ls_items[i]);
error = vfs_register(vfc);
if (error)
return(error);
@@ -593,7 +593,7 @@ _lkm_vfs(lkmtp, cmd)
return(error);
for(i = 0; args->lkm_vnodeops->ls_items[i]; i++)
- vfs_rm_vnodeops((void*)args->lkm_vnodeops->ls_items[i]);
+ vfs_rm_vnodeops((const void*)args->lkm_vnodeops->ls_items[i]);
break;
@@ -628,8 +628,8 @@ _lkm_dev(lkmtp, cmd)
descrip = (dev_t) -1;
else
descrip = makedev(args->lkm_offset,0);
- if ( err = cdevsw_add(&descrip, args->lkm_dev.cdev,
- &(args->lkm_olddev.cdev))) {
+ if ((err = cdevsw_add(&descrip, args->lkm_dev.cdev,
+ &(args->lkm_olddev.cdev))) != 0) {
break;
}
args->lkm_offset = major(descrip) ;
diff --git a/sys/kern/kern_lockf.c b/sys/kern/kern_lockf.c
index cc1b8a5..6e26959 100644
--- a/sys/kern/kern_lockf.c
+++ b/sys/kern/kern_lockf.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)ufs_lockf.c 8.3 (Berkeley) 1/6/94
- * $Id: kern_lockf.c,v 1.19 1998/07/29 17:38:14 bde Exp $
+ * $Id: kern_lockf.c,v 1.20 1998/11/10 09:16:29 peter Exp $
*/
#include "opt_debug_lockf.h"
@@ -360,7 +360,7 @@ lf_setlock(lock)
overlap->lf_type == F_WRLCK) {
lf_wakelock(overlap);
} else {
- while (ltmp = overlap->lf_blkhd.tqh_first) {
+ while ((ltmp = overlap->lf_blkhd.tqh_first) != NULL) {
TAILQ_REMOVE(&overlap->lf_blkhd, ltmp,
lf_block);
TAILQ_INSERT_TAIL(&lock->lf_blkhd,
@@ -717,7 +717,7 @@ lf_wakelock(listhead)
{
register struct lockf *wakelock;
- while (wakelock = listhead->lf_blkhd.tqh_first) {
+ while ((wakelock = listhead->lf_blkhd.tqh_first) != NULL) {
TAILQ_REMOVE(&listhead->lf_blkhd, wakelock, lf_block);
wakelock->lf_next = NOLOCKF;
#ifdef LOCKF_DEBUG
diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c
index 04ca105..d3939b8 100644
--- a/sys/kern/kern_malloc.c
+++ b/sys/kern/kern_malloc.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)kern_malloc.c 8.3 (Berkeley) 1/4/94
- * $Id: kern_malloc.c,v 1.52 1999/01/21 08:29:04 dillon Exp $
+ * $Id: kern_malloc.c,v 1.53 1999/01/21 21:54:32 msmith Exp $
*/
#include "opt_vm.h"
@@ -127,7 +127,7 @@ malloc(size, type, flags)
#ifdef INVARIANTS
long *end, *lp;
int copysize;
- char *savedtype;
+ const char *savedtype;
#endif
register struct malloc_type *ksp = type;
@@ -219,7 +219,7 @@ malloc(size, type, flags)
kbp->kb_next = ((struct freelist *)va)->next;
#ifdef INVARIANTS
freep = (struct freelist *)va;
- savedtype = (char *) type->ks_shortdesc;
+ savedtype = (const char *) type->ks_shortdesc;
#if BYTE_ORDER == BIG_ENDIAN
freep->type = (struct malloc_type *)WEIRD_ADDR >> 16;
#endif
diff --git a/sys/kern/kern_module.c b/sys/kern/kern_module.c
index afe9f2e..ce82661 100644
--- a/sys/kern/kern_module.c
+++ b/sys/kern/kern_module.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: kern_module.c,v 1.13 1999/01/09 14:59:50 dfr Exp $
+ * $Id: kern_module.c,v 1.14 1999/01/09 16:50:04 dfr Exp $
*/
#include <sys/param.h>
@@ -119,7 +119,7 @@ module_register(const char* name, modeventhand_t handler, void* arg, void *file)
} else
newmod->file = 0;
- if (error = MOD_EVENT(newmod, MOD_LOAD)) {
+ if ((error = MOD_EVENT(newmod, MOD_LOAD)) != 0) {
MOD_EVENT(newmod, MOD_UNLOAD);
module_release(newmod);
return error;
@@ -276,7 +276,7 @@ modstat(struct proc* p, struct modstat_args* uap)
/*
* Check the version of the user's structure.
*/
- if (error = copyin(&stat->version, &version, sizeof(version)))
+ if ((error = copyin(&stat->version, &version, sizeof(version))) != 0)
goto out;
if (version != sizeof(struct module_stat_v1)
&& version != sizeof(struct module_stat)) {
@@ -287,19 +287,19 @@ modstat(struct proc* p, struct modstat_args* uap)
namelen = strlen(mod->name) + 1;
if (namelen > MAXMODNAME)
namelen = MAXMODNAME;
- if (error = copyout(mod->name, &stat->name[0], namelen))
+ if ((error = copyout(mod->name, &stat->name[0], namelen)) != 0)
goto out;
- if (error = copyout(&mod->refs, &stat->refs, sizeof(int)))
+ if ((error = copyout(&mod->refs, &stat->refs, sizeof(int))) != 0)
goto out;
- if (error = copyout(&mod->id, &stat->id, sizeof(int)))
+ if ((error = copyout(&mod->id, &stat->id, sizeof(int))) != 0)
goto out;
/*
* >v1 stat includes module data.
*/
if (version == sizeof(struct module_stat)) {
- if (error = copyout(&mod->data, &stat->data, sizeof(mod->data)))
+ if ((error = copyout(&mod->data, &stat->data, sizeof(mod->data))) != 0)
goto out;
}
@@ -316,7 +316,7 @@ modfind(struct proc* p, struct modfind_args* uap)
char name[MAXMODNAME];
module_t mod;
- if (error = copyinstr(SCARG(uap, name), name, sizeof name, 0))
+ if ((error = copyinstr(SCARG(uap, name), name, sizeof name, 0)) != 0)
goto out;
mod = module_lookupbyname(name);
diff --git a/sys/kern/kern_threads.c b/sys/kern/kern_threads.c
index c5ceeae..3d8947f 100644
--- a/sys/kern/kern_threads.c
+++ b/sys/kern/kern_threads.c
@@ -46,7 +46,7 @@
* in Germany will I accept domestic beer. This code may or may not work
* and I certainly make no claims as to its fitness for *any* purpose.
*
- * $Id: kern_threads.c,v 1.10 1998/12/15 17:38:33 des Exp $
+ * $Id: kern_threads.c,v 1.11 1999/01/27 10:14:05 bde Exp $
*/
#include <sys/param.h>
@@ -79,7 +79,7 @@ thr_sleep(struct proc *p, struct thr_sleep_args *uap) {
/*
* Get timespec struct
*/
- if (error = copyin((caddr_t) uap->timeout, (caddr_t) &ts, sizeof ts)) {
+ if ((error = copyin((caddr_t) uap->timeout, (caddr_t) &ts, sizeof ts)) != 0) {
p->p_wakeup = 0;
return error;
}
diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c
index 2bd17bb..b5f0640 100644
--- a/sys/kern/kern_time.c
+++ b/sys/kern/kern_time.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)kern_time.c 8.1 (Berkeley) 6/10/93
- * $Id: kern_time.c,v 1.58 1998/06/09 13:10:53 phk Exp $
+ * $Id: kern_time.c,v 1.59 1998/10/25 17:44:51 phk Exp $
*/
#include <sys/param.h>
@@ -199,7 +199,7 @@ nanosleep1(p, rqt, rmt)
if (rqt->tv_nsec < 0 || rqt->tv_nsec >= 1000000000)
return (EINVAL);
- if (rqt->tv_sec < 0 || rqt->tv_sec == 0 && rqt->tv_nsec == 0)
+ if (rqt->tv_sec < 0 || (rqt->tv_sec == 0 && rqt->tv_nsec == 0))
return (0);
getnanouptime(&ts);
timespecadd(&ts, rqt);
diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c
index 3d86713..ffc38f0 100644
--- a/sys/kern/link_elf.c
+++ b/sys/kern/link_elf.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: link_elf.c,v 1.11 1998/12/31 09:17:20 peter Exp $
+ * $Id: link_elf.c,v 1.12 1999/01/25 08:42:24 dfr Exp $
*/
#include <sys/param.h>
@@ -50,10 +50,10 @@
static int link_elf_load_module(const char*, linker_file_t*);
static int link_elf_load_file(const char*, linker_file_t*);
static int link_elf_lookup_symbol(linker_file_t, const char*,
- linker_sym_t*);
+ c_linker_sym_t*);
static int link_elf_symbol_values(linker_file_t, linker_sym_t, linker_symval_t*);
static int link_elf_search_symbol(linker_file_t, caddr_t value,
- linker_sym_t* sym, long* diffp);
+ c_linker_sym_t* sym, long* diffp);
static void link_elf_unload_file(linker_file_t);
static void link_elf_unload_module(linker_file_t);
@@ -789,7 +789,7 @@ relocate_file(linker_file_t lf)
/* Perform relocations without addend if there are any: */
rel = ef->rel;
if (rel) {
- rellim = (const Elf_Rel *) ((caddr_t) ef->rel + ef->relsize);
+ rellim = (const Elf_Rel *) ((c_caddr_t) ef->rel + ef->relsize);
while (rel < rellim) {
symname = symbol_name(ef, rel->r_info);
if (elf_reloc(lf, rel, ELF_RELOC_REL, symname)) {
@@ -803,7 +803,7 @@ relocate_file(linker_file_t lf)
/* Perform relocations with addend if there are any: */
rela = ef->rela;
if (rela) {
- relalim = (const Elf_Rela *) ((caddr_t) ef->rela + ef->relasize);
+ relalim = (const Elf_Rela *) ((c_caddr_t) ef->rela + ef->relasize);
while (rela < relalim) {
symname = symbol_name(ef, rela->r_info);
if (elf_reloc(lf, rela, ELF_RELOC_RELA, symname)) {
@@ -817,7 +817,7 @@ relocate_file(linker_file_t lf)
/* Perform PLT relocations without addend if there are any: */
rel = ef->pltrel;
if (rel) {
- rellim = (const Elf_Rel *) ((caddr_t) ef->pltrel + ef->pltrelsize);
+ rellim = (const Elf_Rel *) ((c_caddr_t) ef->pltrel + ef->pltrelsize);
while (rel < rellim) {
symname = symbol_name(ef, rel->r_info);
if (elf_reloc(lf, rel, ELF_RELOC_REL, symname)) {
@@ -831,7 +831,7 @@ relocate_file(linker_file_t lf)
/* Perform relocations with addend if there are any: */
rela = ef->pltrela;
if (rela) {
- relalim = (const Elf_Rela *) ((caddr_t) ef->pltrela + ef->pltrelasize);
+ relalim = (const Elf_Rela *) ((c_caddr_t) ef->pltrela + ef->pltrelasize);
while (rela < relalim) {
symname = symbol_name(ef, rela->r_info);
if (elf_reloc(lf, rela, ELF_RELOC_RELA, symname)) {
@@ -866,7 +866,7 @@ elf_hash(const char *name)
}
int
-link_elf_lookup_symbol(linker_file_t lf, const char* name, linker_sym_t* sym)
+link_elf_lookup_symbol(linker_file_t lf, const char* name, c_linker_sym_t* sym)
{
elf_file_t ef = lf->priv;
unsigned long symnum;
@@ -897,7 +897,7 @@ link_elf_lookup_symbol(linker_file_t lf, const char* name, linker_sym_t* sym)
if (symp->st_shndx != SHN_UNDEF ||
(symp->st_value != 0 &&
ELF_ST_TYPE(symp->st_info) == STT_FUNC)) {
- *sym = (linker_sym_t) symp;
+ *sym = (c_linker_sym_t) symp;
return 0;
} else
return ENOENT;
@@ -917,7 +917,7 @@ link_elf_lookup_symbol(linker_file_t lf, const char* name, linker_sym_t* sym)
if (symp->st_shndx != SHN_UNDEF ||
(symp->st_value != 0 &&
ELF_ST_TYPE(symp->st_info) == STT_FUNC)) {
- *sym = (linker_sym_t) symp;
+ *sym = (c_linker_sym_t) symp;
return 0;
} else
return ENOENT;
@@ -952,7 +952,7 @@ link_elf_symbol_values(linker_file_t lf, linker_sym_t sym, linker_symval_t* symv
static int
link_elf_search_symbol(linker_file_t lf, caddr_t value,
- linker_sym_t* sym, long* diffp)
+ c_linker_sym_t* sym, long* diffp)
{
elf_file_t ef = lf->priv;
u_long off = (u_long) value;
@@ -979,7 +979,7 @@ link_elf_search_symbol(linker_file_t lf, caddr_t value,
*diffp = off;
else
*diffp = diff;
- *sym = (linker_sym_t) best;
+ *sym = (c_linker_sym_t) best;
return 0;
}
diff --git a/sys/kern/link_elf_obj.c b/sys/kern/link_elf_obj.c
index 3d86713..ffc38f0 100644
--- a/sys/kern/link_elf_obj.c
+++ b/sys/kern/link_elf_obj.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: link_elf.c,v 1.11 1998/12/31 09:17:20 peter Exp $
+ * $Id: link_elf.c,v 1.12 1999/01/25 08:42:24 dfr Exp $
*/
#include <sys/param.h>
@@ -50,10 +50,10 @@
static int link_elf_load_module(const char*, linker_file_t*);
static int link_elf_load_file(const char*, linker_file_t*);
static int link_elf_lookup_symbol(linker_file_t, const char*,
- linker_sym_t*);
+ c_linker_sym_t*);
static int link_elf_symbol_values(linker_file_t, linker_sym_t, linker_symval_t*);
static int link_elf_search_symbol(linker_file_t, caddr_t value,
- linker_sym_t* sym, long* diffp);
+ c_linker_sym_t* sym, long* diffp);
static void link_elf_unload_file(linker_file_t);
static void link_elf_unload_module(linker_file_t);
@@ -789,7 +789,7 @@ relocate_file(linker_file_t lf)
/* Perform relocations without addend if there are any: */
rel = ef->rel;
if (rel) {
- rellim = (const Elf_Rel *) ((caddr_t) ef->rel + ef->relsize);
+ rellim = (const Elf_Rel *) ((c_caddr_t) ef->rel + ef->relsize);
while (rel < rellim) {
symname = symbol_name(ef, rel->r_info);
if (elf_reloc(lf, rel, ELF_RELOC_REL, symname)) {
@@ -803,7 +803,7 @@ relocate_file(linker_file_t lf)
/* Perform relocations with addend if there are any: */
rela = ef->rela;
if (rela) {
- relalim = (const Elf_Rela *) ((caddr_t) ef->rela + ef->relasize);
+ relalim = (const Elf_Rela *) ((c_caddr_t) ef->rela + ef->relasize);
while (rela < relalim) {
symname = symbol_name(ef, rela->r_info);
if (elf_reloc(lf, rela, ELF_RELOC_RELA, symname)) {
@@ -817,7 +817,7 @@ relocate_file(linker_file_t lf)
/* Perform PLT relocations without addend if there are any: */
rel = ef->pltrel;
if (rel) {
- rellim = (const Elf_Rel *) ((caddr_t) ef->pltrel + ef->pltrelsize);
+ rellim = (const Elf_Rel *) ((c_caddr_t) ef->pltrel + ef->pltrelsize);
while (rel < rellim) {
symname = symbol_name(ef, rel->r_info);
if (elf_reloc(lf, rel, ELF_RELOC_REL, symname)) {
@@ -831,7 +831,7 @@ relocate_file(linker_file_t lf)
/* Perform relocations with addend if there are any: */
rela = ef->pltrela;
if (rela) {
- relalim = (const Elf_Rela *) ((caddr_t) ef->pltrela + ef->pltrelasize);
+ relalim = (const Elf_Rela *) ((c_caddr_t) ef->pltrela + ef->pltrelasize);
while (rela < relalim) {
symname = symbol_name(ef, rela->r_info);
if (elf_reloc(lf, rela, ELF_RELOC_RELA, symname)) {
@@ -866,7 +866,7 @@ elf_hash(const char *name)
}
int
-link_elf_lookup_symbol(linker_file_t lf, const char* name, linker_sym_t* sym)
+link_elf_lookup_symbol(linker_file_t lf, const char* name, c_linker_sym_t* sym)
{
elf_file_t ef = lf->priv;
unsigned long symnum;
@@ -897,7 +897,7 @@ link_elf_lookup_symbol(linker_file_t lf, const char* name, linker_sym_t* sym)
if (symp->st_shndx != SHN_UNDEF ||
(symp->st_value != 0 &&
ELF_ST_TYPE(symp->st_info) == STT_FUNC)) {
- *sym = (linker_sym_t) symp;
+ *sym = (c_linker_sym_t) symp;
return 0;
} else
return ENOENT;
@@ -917,7 +917,7 @@ link_elf_lookup_symbol(linker_file_t lf, const char* name, linker_sym_t* sym)
if (symp->st_shndx != SHN_UNDEF ||
(symp->st_value != 0 &&
ELF_ST_TYPE(symp->st_info) == STT_FUNC)) {
- *sym = (linker_sym_t) symp;
+ *sym = (c_linker_sym_t) symp;
return 0;
} else
return ENOENT;
@@ -952,7 +952,7 @@ link_elf_symbol_values(linker_file_t lf, linker_sym_t sym, linker_symval_t* symv
static int
link_elf_search_symbol(linker_file_t lf, caddr_t value,
- linker_sym_t* sym, long* diffp)
+ c_linker_sym_t* sym, long* diffp)
{
elf_file_t ef = lf->priv;
u_long off = (u_long) value;
@@ -979,7 +979,7 @@ link_elf_search_symbol(linker_file_t lf, caddr_t value,
*diffp = off;
else
*diffp = diff;
- *sym = (linker_sym_t) best;
+ *sym = (c_linker_sym_t) best;
return 0;
}
diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c
index dc4c88a..283dd60 100644
--- a/sys/kern/subr_bus.c
+++ b/sys/kern/subr_bus.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: subr_bus.c,v 1.13 1999/01/10 22:04:05 n_hibma Exp $
+ * $Id: subr_bus.c,v 1.14 1999/01/16 17:44:09 dfr Exp $
*/
#include <sys/param.h>
@@ -265,7 +265,7 @@ devclass_delete_driver(devclass_t busclass, driver_t *driver)
if (dc->devices[i]) {
dev = dc->devices[i];
if (dev->driver == driver) {
- if (error = device_detach(dev))
+ if ((error = device_detach(dev)) != 0)
return error;
device_set_driver(dev, NULL);
}
@@ -411,7 +411,7 @@ devclass_add_device(devclass_t dc, device_t dev)
PDEBUG(("%s in devclass %s", DEVICENAME(dev), DEVCLANAME(dc)));
- if (error = devclass_alloc_unit(dc, &dev->unit))
+ if ((error = devclass_alloc_unit(dc, &dev->unit)) != 0)
return error;
dc->devices[dev->unit] = dev;
dev->devclass = dc;
@@ -456,7 +456,7 @@ make_device(device_t parent, const char *name,
return NULL;
}
- if (error = devclass_alloc_unit(dc, &unit))
+ if ((error = devclass_alloc_unit(dc, &unit)) != 0)
return NULL;
} else
dc = NULL;
@@ -555,7 +555,7 @@ device_delete_child(device_t dev, device_t child)
return error;
}
- if (error = device_detach(child))
+ if ((error = device_detach(child)) != 0)
return error;
if (child->devclass)
devclass_delete_device(child->devclass, child);
@@ -883,7 +883,7 @@ device_detach(device_t dev)
if (dev->state != DS_ATTACHED)
return 0;
- if (error = DEVICE_DETACH(dev))
+ if ((error = DEVICE_DETACH(dev)) != 0)
return error;
if (!(dev->flags & DF_FIXEDCLASS))
@@ -1052,7 +1052,7 @@ bus_generic_detach(device_t dev)
for (child = TAILQ_FIRST(&dev->children);
child; child = TAILQ_NEXT(child, link))
- if (error = device_detach(child))
+ if ((error = device_detach(child)) != 0)
return error;
return 0;
diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c
index 8d90ee9..8d745f4 100644
--- a/sys/kern/sys_generic.c
+++ b/sys/kern/sys_generic.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)sys_generic.c 8.5 (Berkeley) 1/21/94
- * $Id: sys_generic.c,v 1.42 1998/11/11 10:03:55 truckman Exp $
+ * $Id: sys_generic.c,v 1.43 1998/12/10 01:53:26 jkh Exp $
*/
#include "opt_ktrace.h"
@@ -248,7 +248,7 @@ write(p, uap)
(fp = fdp->fd_ofiles[uap->fd]) == NULL ||
(fp->f_flag & FWRITE) == 0)
return (EBADF);
- aiov.iov_base = (caddr_t)uap->buf;
+ aiov.iov_base = (c_caddr_t)uap->buf;
aiov.iov_len = uap->nbyte;
auio.uio_iov = &aiov;
auio.uio_iovcnt = 1;
diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c
index c0190d2..6deefed 100644
--- a/sys/kern/sys_pipe.c
+++ b/sys/kern/sys_pipe.c
@@ -16,7 +16,7 @@
* 4. Modifications may be freely made to this file if the above conditions
* are met.
*
- * $Id: sys_pipe.c,v 1.46 1998/12/07 21:58:29 archie Exp $
+ * $Id: sys_pipe.c,v 1.47 1999/01/27 10:10:02 bde Exp $
*/
/*
@@ -282,8 +282,8 @@ pipelock(cpipe, catch)
int error;
while (cpipe->pipe_state & PIPE_LOCK) {
cpipe->pipe_state |= PIPE_LWANT;
- if (error = tsleep( cpipe,
- catch?(PRIBIO|PCATCH):PRIBIO, "pipelk", 0)) {
+ if ((error = tsleep( cpipe,
+ catch?(PRIBIO|PCATCH):PRIBIO, "pipelk", 0)) != 0) {
return error;
}
}
@@ -424,7 +424,7 @@ pipe_read(fp, uio, cred)
}
rpipe->pipe_state |= PIPE_WANTR;
- if (error = tsleep(rpipe, PRIBIO|PCATCH, "piperd", 0)) {
+ if ((error = tsleep(rpipe, PRIBIO|PCATCH, "piperd", 0)) != 0) {
break;
}
}
@@ -864,7 +864,7 @@ pipe_write(fp, uio, cred)
pipeselwakeup(wpipe);
wpipe->pipe_state |= PIPE_WANTW;
- if (error = tsleep(wpipe, (PRIBIO+1)|PCATCH, "pipewr", 0)) {
+ if ((error = tsleep(wpipe, (PRIBIO+1)|PCATCH, "pipewr", 0)) != 0) {
break;
}
/*
@@ -1071,7 +1071,7 @@ pipeclose(cpipe)
/*
* Disconnect from peer
*/
- if (ppipe = cpipe->pipe_peer) {
+ if ((ppipe = cpipe->pipe_peer) != NULL) {
pipeselwakeup(ppipe);
ppipe->pipe_state |= PIPE_EOF;
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c
index 4756127..51545e6 100644
--- a/sys/kern/sys_process.c
+++ b/sys/kern/sys_process.c
@@ -28,7 +28,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: sys_process.c,v 1.40 1998/07/29 18:41:30 dfr Exp $
+ * $Id: sys_process.c,v 1.41 1998/12/26 17:14:37 dfr Exp $
*/
#include <sys/param.h>
@@ -239,7 +239,7 @@ ptrace(curp, uap)
/* not owned by you, has done setuid (unless you're root) */
if ((p->p_cred->p_ruid != curp->p_cred->p_ruid) ||
(p->p_flag & P_SUGID)) {
- if (error = suser(curp->p_ucred, &curp->p_acflag))
+ if ((error = suser(curp->p_ucred, &curp->p_acflag)) != 0)
return error;
}
diff --git a/sys/kern/tty_snoop.c b/sys/kern/tty_snoop.c
index ba71a94..686aa27 100644
--- a/sys/kern/tty_snoop.c
+++ b/sys/kern/tty_snoop.c
@@ -172,7 +172,7 @@ snpread(dev, uio, flag)
if (((nblen / 2) >= SNOOP_MINLEN) && (nblen / 2) >= snp->snp_len) {
while (((nblen / 2) >= snp->snp_len) && ((nblen / 2) >= SNOOP_MINLEN))
nblen = nblen / 2;
- if (nbuf = malloc(nblen, M_TTYS, M_NOWAIT)) {
+ if ((nbuf = malloc(nblen, M_TTYS, M_NOWAIT)) != NULL) {
bcopy(snp->snp_buf + snp->snp_base, nbuf, snp->snp_len);
free(snp->snp_buf, M_TTYS);
snp->snp_buf = nbuf;
@@ -291,7 +291,7 @@ snpopen(dev, flag, mode, p)
struct snoop *snp;
register int unit, error;
- if (error = suser(p->p_ucred, &p->p_acflag))
+ if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
return (error);
if ((unit = minor(dev)) >= NSNP)
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index 77a4331..9e953da 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)uipc_socket.c 8.3 (Berkeley) 4/15/94
- * $Id: uipc_socket.c,v 1.51 1999/01/20 17:45:22 fenner Exp $
+ * $Id: uipc_socket.c,v 1.52 1999/01/25 16:58:52 fenner Exp $
*/
#include <sys/param.h>
@@ -415,7 +415,7 @@ sosend(so, addr, uio, top, control, flags, p)
* Also check to make sure that MSG_EOR isn't used on SOCK_STREAM
* type sockets since that's an error.
*/
- if (resid < 0 || so->so_type == SOCK_STREAM && (flags & MSG_EOR)) {
+ if (resid < 0 || (so->so_type == SOCK_STREAM && (flags & MSG_EOR))) {
error = EINVAL;
goto out;
}
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c
index e23373c..6909958 100644
--- a/sys/kern/uipc_syscalls.c
+++ b/sys/kern/uipc_syscalls.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)uipc_syscalls.c 8.4 (Berkeley) 2/21/94
- * $Id: uipc_syscalls.c,v 1.53 1999/01/24 03:49:58 dillon Exp $
+ * $Id: uipc_syscalls.c,v 1.54 1999/01/25 16:53:53 fenner Exp $
*/
#include "opt_compat.h"
@@ -797,8 +797,8 @@ recvit(p, s, mp, namelenp)
tocopy = len;
}
- if (error = copyout((caddr_t)mtod(m, caddr_t),
- ctlbuf, tocopy))
+ if ((error = copyout((caddr_t)mtod(m, caddr_t),
+ ctlbuf, tocopy)) != 0)
goto out;
ctlbuf += tocopy;
diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c
index c1af873..08ebd85 100644
--- a/sys/kern/vfs_aio.c
+++ b/sys/kern/vfs_aio.c
@@ -13,7 +13,7 @@
* bad that happens because of using this software isn't the responsibility
* of the author. This software is distributed AS-IS.
*
- * $Id: vfs_aio.c,v 1.36 1998/12/15 17:38:33 des Exp $
+ * $Id: vfs_aio.c,v 1.37 1999/01/21 08:29:05 dillon Exp $
*/
/*
@@ -720,7 +720,7 @@ aio_daemon(void *uproc)
/*
* Check for jobs
*/
- while ( aiocbe = aio_selectjob(aiop)) {
+ while ((aiocbe = aio_selectjob(aiop)) != NULL) {
struct proc *userp;
struct aiocb *cb;
struct kaioinfo *ki;
@@ -925,7 +925,7 @@ aio_newproc()
rfa.flags = RFPROC | RFCFDG;
p = curproc;
- if (error = rfork(p, &rfa))
+ if ((error = rfork(p, &rfa)) != 0)
return error;
np = pfind(p->p_retval[0]);
@@ -1193,7 +1193,7 @@ _aio_aqueue(struct proc *p, struct aiocb *job, struct aio_liojob *lj, int type)
struct aioproclist *aiop;
struct kaioinfo *ki;
- if (aiocbe = TAILQ_FIRST(&aio_freejobs)) {
+ if ((aiocbe = TAILQ_FIRST(&aio_freejobs)) != NULL) {
TAILQ_REMOVE(&aio_freejobs, aiocbe, list);
} else {
aiocbe = zalloc (aiocb_zone);
@@ -1338,7 +1338,7 @@ _aio_aqueue(struct proc *p, struct aiocb *job, struct aio_liojob *lj, int type)
* correct thing to do.
*/
retryproc:
- if (aiop = TAILQ_FIRST(&aio_freeproc)) {
+ if ((aiop = TAILQ_FIRST(&aio_freeproc)) != NULL) {
TAILQ_REMOVE(&aio_freeproc, aiop, list);
TAILQ_INSERT_TAIL(&aio_activeproc, aiop, list);
aiop->aioprocflags &= ~AIOP_FREE;
@@ -1471,7 +1471,7 @@ aio_suspend(struct proc *p, struct aio_suspend_args *uap)
/*
* Get timespec struct
*/
- if (error = copyin((caddr_t) uap->timeout, (caddr_t) &ts, sizeof ts)) {
+ if ((error = copyin((caddr_t) uap->timeout, (caddr_t) &ts, sizeof ts)) != 0) {
return error;
}
@@ -1665,7 +1665,7 @@ aio_read(struct proc *p, struct aio_read_args *uap)
/*
* Get control block
*/
- if (error = copyin((caddr_t) uap->aiocbp, (caddr_t) &iocb, sizeof iocb))
+ if ((error = copyin((caddr_t) uap->aiocbp, (caddr_t) &iocb, sizeof iocb)) != 0)
return error;
/*
@@ -1738,7 +1738,7 @@ aio_write(struct proc *p, struct aio_write_args *uap)
return aio_aqueue(p, (struct aiocb *) uap->aiocbp, LIO_WRITE);
}
- if (error = copyin((caddr_t) uap->aiocbp, (caddr_t) &iocb, sizeof iocb))
+ if ((error = copyin((caddr_t) uap->aiocbp, (caddr_t) &iocb, sizeof iocb)) != 0)
return error;
/*
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index 5d3b1ff..7511159 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -11,7 +11,7 @@
* 2. Absolutely no warranty of function or purpose is made by the author
* John S. Dyson.
*
- * $Id: vfs_bio.c,v 1.197 1999/01/23 06:36:15 dillon Exp $
+ * $Id: vfs_bio.c,v 1.198 1999/01/24 00:51:11 dillon Exp $
*/
/*
@@ -142,7 +142,7 @@ SYSCTL_INT(_vfs, OID_AUTO, kvafreespace, CTLFLAG_RD,
&kvafreespace, 0, "");
static LIST_HEAD(bufhashhdr, buf) bufhashtbl[BUFHSZ], invalhash;
-struct bqueues bufqueues[BUFFER_QUEUES] = {0};
+struct bqueues bufqueues[BUFFER_QUEUES] = { { 0 } };
extern int vm_swap_size;
diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c
index 781508e..27e9167 100644
--- a/sys/kern/vfs_cluster.c
+++ b/sys/kern/vfs_cluster.c
@@ -33,7 +33,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_cluster.c 8.7 (Berkeley) 2/13/94
- * $Id: vfs_cluster.c,v 1.77 1999/01/10 01:58:25 eivind Exp $
+ * $Id: vfs_cluster.c,v 1.78 1999/01/21 08:29:05 dillon Exp $
*/
#include "opt_debug_cluster.h"
@@ -367,7 +367,7 @@ cluster_rbuild(vp, filesize, lbn, blkno, size, run, fbp)
round_page(size) > vp->v_maxio)
break;
- if (tbp = incore(vp, lbn + i)) {
+ if ((tbp = incore(vp, lbn + i)) != NULL) {
if (tbp->b_flags & B_BUSY)
break;
diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c
index 9b444fc..548b480 100644
--- a/sys/kern/vfs_extattr.c
+++ b/sys/kern/vfs_extattr.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
- * $Id: vfs_syscalls.c,v 1.112 1999/01/05 18:49:55 eivind Exp $
+ * $Id: vfs_syscalls.c,v 1.113 1999/01/24 06:28:37 bde Exp $
*/
/* For 4.3 integer FS ID compatibility */
@@ -123,7 +123,7 @@ mount(p, uap)
*/
NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE,
SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
vp = nd.ni_vp;
if (SCARG(uap, flags) & MNT_UPDATE) {
@@ -193,7 +193,7 @@ mount(p, uap)
}
SCARG(uap, flags) |= MNT_NOSUID | MNT_NODEV;
}
- if (error = vinvalbuf(vp, V_SAVE, p->p_ucred, p, 0, 0))
+ if ((error = vinvalbuf(vp, V_SAVE, p->p_ucred, p, 0, 0)) != 0)
return (error);
if (vp->v_type != VDIR) {
vput(vp);
@@ -217,7 +217,7 @@ mount(p, uap)
strncpy(fstypename, vfsp->vfc_name, MFSNAMELEN);
} else
#endif /* COMPAT_43 */
- if (error = copyinstr(SCARG(uap, type), fstypename, MFSNAMELEN, NULL)) {
+ if ((error = copyinstr(SCARG(uap, type), fstypename, MFSNAMELEN, NULL)) != 0) {
vput(vp);
return (error);
}
@@ -233,7 +233,7 @@ mount(p, uap)
return EPERM;
}
/* Only load modules for root (very important!) */
- if (error = suser(p->p_ucred, &p->p_acflag)) {
+ if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) {
vput(vp);
return error;
}
@@ -342,7 +342,7 @@ update:
if ((mp->mnt_flag & MNT_RDONLY) == 0)
error = vfs_allocate_syncvnode(mp);
vfs_unbusy(mp, p);
- if (error = VFS_START(mp, 0, p))
+ if ((error = VFS_START(mp, 0, p)) != 0)
vrele(vp);
} else {
simple_lock(&vp->v_interlock);
@@ -422,7 +422,7 @@ unmount(p, uap)
NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE,
SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
vp = nd.ni_vp;
mp = vp->v_mount;
@@ -595,7 +595,7 @@ quotactl(p, uap)
struct nameidata nd;
NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
mp = nd.ni_vp->v_mount;
vrele(nd.ni_vp);
@@ -628,7 +628,7 @@ statfs(p, uap)
struct statfs sb;
NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
mp = nd.ni_vp->v_mount;
sp = &mp->mnt_stat;
@@ -669,7 +669,7 @@ fstatfs(p, uap)
int error;
struct statfs sb;
- if (error = getvnode(p->p_fd, SCARG(uap, fd), &fp))
+ if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0)
return (error);
mp = ((struct vnode *)fp->f_data)->v_mount;
sp = &mp->mnt_stat;
@@ -776,7 +776,7 @@ fchdir(p, uap)
struct file *fp;
int error;
- if (error = getvnode(fdp, SCARG(uap, fd), &fp))
+ if ((error = getvnode(fdp, SCARG(uap, fd), &fp)) != 0)
return (error);
vp = (struct vnode *)fp->f_data;
VREF(vp);
@@ -827,7 +827,7 @@ chdir(p, uap)
NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE,
SCARG(uap, path), p);
- if (error = change_dir(&nd, p))
+ if ((error = change_dir(&nd, p)) != 0)
return (error);
vrele(fdp->fd_cdir);
fdp->fd_cdir = nd.ni_vp;
@@ -859,7 +859,7 @@ chroot(p, uap)
return (error);
NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE,
SCARG(uap, path), p);
- if (error = change_dir(&nd, p))
+ if ((error = change_dir(&nd, p)) != 0)
return (error);
vrele(fdp->fd_rdir);
fdp->fd_rdir = nd.ni_vp;
@@ -966,7 +966,7 @@ open(p, uap)
if ((flags & FNONBLOCK) == 0)
type |= F_WAIT;
VOP_UNLOCK(vp, 0, p);
- if (error = VOP_ADVLOCK(vp, (caddr_t)fp, F_SETLK, &lf, type)) {
+ if ((error = VOP_ADVLOCK(vp, (caddr_t)fp, F_SETLK, &lf, type)) != 0) {
(void) vn_close(vp, fp->f_flag, fp->f_cred, p);
ffree(fp);
fdp->fd_ofiles[indx] = NULL;
@@ -1043,7 +1043,7 @@ mknod(p, uap)
if (error)
return (error);
NDINIT(&nd, CREATE, LOCKPARENT, UIO_USERSPACE, SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
vp = nd.ni_vp;
if (vp != NULL)
@@ -1121,7 +1121,7 @@ mkfifo(p, uap)
struct nameidata nd;
NDINIT(&nd, CREATE, LOCKPARENT, UIO_USERSPACE, SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
if (nd.ni_vp != NULL) {
VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd);
@@ -1164,7 +1164,7 @@ link(p, uap)
int error;
NDINIT(&nd, LOOKUP, FOLLOW|NOOBJ, UIO_USERSPACE, SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
vp = nd.ni_vp;
if (vp->v_type == VDIR)
@@ -1220,10 +1220,10 @@ symlink(p, uap)
struct nameidata nd;
path = zalloc(namei_zone);
- if (error = copyinstr(SCARG(uap, path), path, MAXPATHLEN, NULL))
+ if ((error = copyinstr(SCARG(uap, path), path, MAXPATHLEN, NULL)) != 0)
goto out;
NDINIT(&nd, CREATE, LOCKPARENT|NOOBJ, UIO_USERSPACE, SCARG(uap, link), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
goto out;
if (nd.ni_vp) {
VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd);
@@ -1279,7 +1279,7 @@ undelete(p, uap)
}
VOP_LEASE(nd.ni_dvp, p, p->p_ucred, LEASE_WRITE);
- if (error = VOP_WHITEOUT(nd.ni_dvp, &nd.ni_cnd, DELETE))
+ if ((error = VOP_WHITEOUT(nd.ni_dvp, &nd.ni_cnd, DELETE)) != 0)
VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd);
vput(nd.ni_dvp);
ASSERT_VOP_UNLOCKED(nd.ni_dvp, "undelete");
@@ -1308,7 +1308,7 @@ unlink(p, uap)
struct nameidata nd;
NDINIT(&nd, DELETE, LOCKPARENT, UIO_USERSPACE, SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
vp = nd.ni_vp;
VOP_LEASE(vp, p, p->p_ucred, LEASE_WRITE);
@@ -1459,7 +1459,7 @@ access(p, uap)
cred->cr_groups[0] = p->p_cred->p_rgid;
NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | NOOBJ, UIO_USERSPACE,
SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
goto out1;
vp = nd.ni_vp;
@@ -1508,7 +1508,7 @@ ostat(p, uap)
NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | NOOBJ, UIO_USERSPACE,
SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
error = vn_stat(nd.ni_vp, &sb, p);
vput(nd.ni_vp);
@@ -1545,7 +1545,7 @@ olstat(p, uap)
NDINIT(&nd, LOOKUP, NOFOLLOW | LOCKLEAF | NOOBJ, UIO_USERSPACE,
SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
vp = nd.ni_vp;
error = vn_stat(vp, &sb, p);
@@ -1611,7 +1611,7 @@ stat(p, uap)
NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | NOOBJ, UIO_USERSPACE,
SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
error = vn_stat(nd.ni_vp, &sb, p);
vput(nd.ni_vp);
@@ -1646,7 +1646,7 @@ lstat(p, uap)
NDINIT(&nd, LOOKUP, NOFOLLOW | LOCKLEAF | NOOBJ, UIO_USERSPACE,
SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
vp = nd.ni_vp;
error = vn_stat(vp, &sb, p);
@@ -1701,7 +1701,7 @@ nstat(p, uap)
NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | NOOBJ, UIO_USERSPACE,
SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
error = vn_stat(nd.ni_vp, &sb, p);
vput(nd.ni_vp);
@@ -1738,7 +1738,7 @@ nlstat(p, uap)
NDINIT(&nd, LOOKUP, NOFOLLOW | LOCKLEAF | NOOBJ, UIO_USERSPACE,
SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
vp = nd.ni_vp;
error = vn_stat(vp, &sb, p);
@@ -1773,7 +1773,7 @@ pathconf(p, uap)
NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | NOOBJ, UIO_USERSPACE,
SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
error = VOP_PATHCONF(nd.ni_vp, SCARG(uap, name), p->p_retval);
vput(nd.ni_vp);
@@ -1808,7 +1808,7 @@ readlink(p, uap)
NDINIT(&nd, LOOKUP, NOFOLLOW | LOCKLEAF | NOOBJ, UIO_USERSPACE,
SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
vp = nd.ni_vp;
if (vp->v_type != VLNK)
@@ -1870,7 +1870,7 @@ chflags(p, uap)
struct nameidata nd;
NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
error = setfflags(p, nd.ni_vp, SCARG(uap, flags));
vrele(nd.ni_vp);
@@ -1898,7 +1898,7 @@ fchflags(p, uap)
struct file *fp;
int error;
- if (error = getvnode(p->p_fd, SCARG(uap, fd), &fp))
+ if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0)
return (error);
return setfflags(p, (struct vnode *) fp->f_data, SCARG(uap, flags));
}
@@ -1943,7 +1943,7 @@ chmod(p, uap)
struct nameidata nd;
NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
error = setfmode(p, nd.ni_vp, SCARG(uap, mode));
vrele(nd.ni_vp);
@@ -1972,7 +1972,7 @@ lchmod(p, uap)
struct nameidata nd;
NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
error = setfmode(p, nd.ni_vp, SCARG(uap, mode));
vrele(nd.ni_vp);
@@ -2000,7 +2000,7 @@ fchmod(p, uap)
struct file *fp;
int error;
- if (error = getvnode(p->p_fd, SCARG(uap, fd), &fp))
+ if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0)
return (error);
return setfmode(p, (struct vnode *)fp->f_data, SCARG(uap, mode));
}
@@ -2049,7 +2049,7 @@ chown(p, uap)
struct nameidata nd;
NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
error = setfown(p, nd.ni_vp, SCARG(uap, uid), SCARG(uap, gid));
vrele(nd.ni_vp);
@@ -2081,7 +2081,7 @@ lchown(p, uap)
struct nameidata nd;
NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
error = setfown(p, nd.ni_vp, SCARG(uap, uid), SCARG(uap, gid));
vrele(nd.ni_vp);
@@ -2111,7 +2111,7 @@ fchown(p, uap)
struct file *fp;
int error;
- if (error = getvnode(p->p_fd, SCARG(uap, fd), &fp))
+ if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0)
return (error);
return setfown(p, (struct vnode *)fp->f_data,
SCARG(uap, uid), SCARG(uap, gid));
@@ -2169,11 +2169,11 @@ utimes(p, uap)
microtime(&tv[0]);
tv[1] = tv[0];
nullflag = 1;
- } else if (error = copyin((caddr_t)SCARG(uap, tptr), (caddr_t)tv,
- sizeof (tv)))
+ } else if ((error = copyin((caddr_t)SCARG(uap, tptr), (caddr_t)tv,
+ sizeof (tv))) != 0)
return (error);
NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
error = setutimes(p, nd.ni_vp, tv, nullflag);
vrele(nd.ni_vp);
@@ -2208,11 +2208,11 @@ lutimes(p, uap)
microtime(&tv[0]);
tv[1] = tv[0];
nullflag = 1;
- } else if (error = copyin((caddr_t)SCARG(uap, tptr), (caddr_t)tv,
- sizeof (tv)))
+ } else if ((error = copyin((caddr_t)SCARG(uap, tptr), (caddr_t)tv,
+ sizeof (tv))) != 0)
return (error);
NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
error = setutimes(p, nd.ni_vp, tv, nullflag);
@@ -2248,11 +2248,11 @@ futimes(p, uap)
microtime(&tv[0]);
tv[1] = tv[0];
nullflag = 1;
- } else if (error = copyin((caddr_t)SCARG(uap, tptr), (caddr_t)tv,
- sizeof (tv)))
+ } else if ((error = copyin((caddr_t)SCARG(uap, tptr), (caddr_t)tv,
+ sizeof (tv))) != 0)
return (error);
- if (error = getvnode(p->p_fd, SCARG(uap, fd), &fp))
+ if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0)
return (error);
return setutimes(p, (struct vnode *)fp->f_data, tv, nullflag);
}
@@ -2285,7 +2285,7 @@ truncate(p, uap)
if (uap->length < 0)
return(EINVAL);
NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
vp = nd.ni_vp;
VOP_LEASE(vp, p, p->p_ucred, LEASE_WRITE);
@@ -2329,7 +2329,7 @@ ftruncate(p, uap)
if (uap->length < 0)
return(EINVAL);
- if (error = getvnode(p->p_fd, SCARG(uap, fd), &fp))
+ if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0)
return (error);
if ((fp->f_flag & FWRITE) == 0)
return (EINVAL);
@@ -2427,7 +2427,7 @@ fsync(p, uap)
struct file *fp;
int error;
- if (error = getvnode(p->p_fd, SCARG(uap, fd), &fp))
+ if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0)
return (error);
vp = (struct vnode *)fp->f_data;
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p);
@@ -2466,14 +2466,14 @@ rename(p, uap)
NDINIT(&fromnd, DELETE, WANTPARENT | SAVESTART, UIO_USERSPACE,
SCARG(uap, from), p);
- if (error = namei(&fromnd))
+ if ((error = namei(&fromnd)) != 0)
return (error);
fvp = fromnd.ni_vp;
NDINIT(&tond, RENAME, LOCKPARENT | LOCKLEAF | NOCACHE | SAVESTART | NOOBJ,
UIO_USERSPACE, SCARG(uap, to), p);
if (fromnd.ni_vp->v_type == VDIR)
tond.ni_cnd.cn_flags |= WILLBEDIR;
- if (error = namei(&tond)) {
+ if ((error = namei(&tond)) != 0) {
/* Translate error code for rename("dir1", "dir2/."). */
if (error == EISDIR && fvp->v_type == VDIR)
error = EINVAL;
@@ -2568,7 +2568,7 @@ mkdir(p, uap)
NDINIT(&nd, CREATE, LOCKPARENT, UIO_USERSPACE, SCARG(uap, path), p);
nd.ni_cnd.cn_flags |= WILLBEDIR;
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
vp = nd.ni_vp;
if (vp != NULL) {
@@ -2615,7 +2615,7 @@ rmdir(p, uap)
NDINIT(&nd, DELETE, LOCKPARENT | LOCKLEAF, UIO_USERSPACE,
SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
vp = nd.ni_vp;
if (vp->v_type != VDIR) {
@@ -2684,7 +2684,7 @@ ogetdirentries(p, uap)
int error, eofflag, readcnt;
long loff;
- if (error = getvnode(p->p_fd, SCARG(uap, fd), &fp))
+ if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0)
return (error);
if ((fp->f_flag & FREAD) == 0)
return (EBADF);
@@ -2798,7 +2798,7 @@ getdirentries(p, uap)
long loff;
int error, eofflag;
- if (error = getvnode(p->p_fd, SCARG(uap, fd), &fp))
+ if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0)
return (error);
if ((fp->f_flag & FREAD) == 0)
return (EBADF);
@@ -2906,14 +2906,14 @@ revoke(p, uap)
struct nameidata nd;
NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
vp = nd.ni_vp;
if (vp->v_type != VCHR && vp->v_type != VBLK) {
error = EINVAL;
goto out;
}
- if (error = VOP_GETATTR(vp, &vattr, p->p_ucred, p))
+ if ((error = VOP_GETATTR(vp, &vattr, p->p_ucred, p)) != 0)
goto out;
if (p->p_ucred->cr_uid != vattr.va_uid &&
(error = suser(p->p_ucred, &p->p_acflag)))
diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c
index 67efd52..30b28a7 100644
--- a/sys/kern/vfs_lookup.c
+++ b/sys/kern/vfs_lookup.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_lookup.c 8.4 (Berkeley) 2/16/94
- * $Id: vfs_lookup.c,v 1.30 1999/01/08 17:31:16 eivind Exp $
+ * $Id: vfs_lookup.c,v 1.31 1999/01/10 01:58:26 eivind Exp $
*/
#include "opt_ktrace.h"
@@ -414,7 +414,7 @@ unionlookup:
ndp->ni_dvp = dp;
ndp->ni_vp = NULL;
ASSERT_VOP_LOCKED(dp, "lookup");
- if (error = VOP_LOOKUP(dp, &ndp->ni_vp, cnp)) {
+ if ((error = VOP_LOOKUP(dp, &ndp->ni_vp, cnp)) != 0) {
KASSERT(ndp->ni_vp == NULL, ("leaf should be empty"));
#ifdef NAMEI_DIAGNOSTIC
printf("not found\n");
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index 9b444fc..548b480 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
- * $Id: vfs_syscalls.c,v 1.112 1999/01/05 18:49:55 eivind Exp $
+ * $Id: vfs_syscalls.c,v 1.113 1999/01/24 06:28:37 bde Exp $
*/
/* For 4.3 integer FS ID compatibility */
@@ -123,7 +123,7 @@ mount(p, uap)
*/
NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE,
SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
vp = nd.ni_vp;
if (SCARG(uap, flags) & MNT_UPDATE) {
@@ -193,7 +193,7 @@ mount(p, uap)
}
SCARG(uap, flags) |= MNT_NOSUID | MNT_NODEV;
}
- if (error = vinvalbuf(vp, V_SAVE, p->p_ucred, p, 0, 0))
+ if ((error = vinvalbuf(vp, V_SAVE, p->p_ucred, p, 0, 0)) != 0)
return (error);
if (vp->v_type != VDIR) {
vput(vp);
@@ -217,7 +217,7 @@ mount(p, uap)
strncpy(fstypename, vfsp->vfc_name, MFSNAMELEN);
} else
#endif /* COMPAT_43 */
- if (error = copyinstr(SCARG(uap, type), fstypename, MFSNAMELEN, NULL)) {
+ if ((error = copyinstr(SCARG(uap, type), fstypename, MFSNAMELEN, NULL)) != 0) {
vput(vp);
return (error);
}
@@ -233,7 +233,7 @@ mount(p, uap)
return EPERM;
}
/* Only load modules for root (very important!) */
- if (error = suser(p->p_ucred, &p->p_acflag)) {
+ if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) {
vput(vp);
return error;
}
@@ -342,7 +342,7 @@ update:
if ((mp->mnt_flag & MNT_RDONLY) == 0)
error = vfs_allocate_syncvnode(mp);
vfs_unbusy(mp, p);
- if (error = VFS_START(mp, 0, p))
+ if ((error = VFS_START(mp, 0, p)) != 0)
vrele(vp);
} else {
simple_lock(&vp->v_interlock);
@@ -422,7 +422,7 @@ unmount(p, uap)
NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE,
SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
vp = nd.ni_vp;
mp = vp->v_mount;
@@ -595,7 +595,7 @@ quotactl(p, uap)
struct nameidata nd;
NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
mp = nd.ni_vp->v_mount;
vrele(nd.ni_vp);
@@ -628,7 +628,7 @@ statfs(p, uap)
struct statfs sb;
NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
mp = nd.ni_vp->v_mount;
sp = &mp->mnt_stat;
@@ -669,7 +669,7 @@ fstatfs(p, uap)
int error;
struct statfs sb;
- if (error = getvnode(p->p_fd, SCARG(uap, fd), &fp))
+ if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0)
return (error);
mp = ((struct vnode *)fp->f_data)->v_mount;
sp = &mp->mnt_stat;
@@ -776,7 +776,7 @@ fchdir(p, uap)
struct file *fp;
int error;
- if (error = getvnode(fdp, SCARG(uap, fd), &fp))
+ if ((error = getvnode(fdp, SCARG(uap, fd), &fp)) != 0)
return (error);
vp = (struct vnode *)fp->f_data;
VREF(vp);
@@ -827,7 +827,7 @@ chdir(p, uap)
NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE,
SCARG(uap, path), p);
- if (error = change_dir(&nd, p))
+ if ((error = change_dir(&nd, p)) != 0)
return (error);
vrele(fdp->fd_cdir);
fdp->fd_cdir = nd.ni_vp;
@@ -859,7 +859,7 @@ chroot(p, uap)
return (error);
NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE,
SCARG(uap, path), p);
- if (error = change_dir(&nd, p))
+ if ((error = change_dir(&nd, p)) != 0)
return (error);
vrele(fdp->fd_rdir);
fdp->fd_rdir = nd.ni_vp;
@@ -966,7 +966,7 @@ open(p, uap)
if ((flags & FNONBLOCK) == 0)
type |= F_WAIT;
VOP_UNLOCK(vp, 0, p);
- if (error = VOP_ADVLOCK(vp, (caddr_t)fp, F_SETLK, &lf, type)) {
+ if ((error = VOP_ADVLOCK(vp, (caddr_t)fp, F_SETLK, &lf, type)) != 0) {
(void) vn_close(vp, fp->f_flag, fp->f_cred, p);
ffree(fp);
fdp->fd_ofiles[indx] = NULL;
@@ -1043,7 +1043,7 @@ mknod(p, uap)
if (error)
return (error);
NDINIT(&nd, CREATE, LOCKPARENT, UIO_USERSPACE, SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
vp = nd.ni_vp;
if (vp != NULL)
@@ -1121,7 +1121,7 @@ mkfifo(p, uap)
struct nameidata nd;
NDINIT(&nd, CREATE, LOCKPARENT, UIO_USERSPACE, SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
if (nd.ni_vp != NULL) {
VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd);
@@ -1164,7 +1164,7 @@ link(p, uap)
int error;
NDINIT(&nd, LOOKUP, FOLLOW|NOOBJ, UIO_USERSPACE, SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
vp = nd.ni_vp;
if (vp->v_type == VDIR)
@@ -1220,10 +1220,10 @@ symlink(p, uap)
struct nameidata nd;
path = zalloc(namei_zone);
- if (error = copyinstr(SCARG(uap, path), path, MAXPATHLEN, NULL))
+ if ((error = copyinstr(SCARG(uap, path), path, MAXPATHLEN, NULL)) != 0)
goto out;
NDINIT(&nd, CREATE, LOCKPARENT|NOOBJ, UIO_USERSPACE, SCARG(uap, link), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
goto out;
if (nd.ni_vp) {
VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd);
@@ -1279,7 +1279,7 @@ undelete(p, uap)
}
VOP_LEASE(nd.ni_dvp, p, p->p_ucred, LEASE_WRITE);
- if (error = VOP_WHITEOUT(nd.ni_dvp, &nd.ni_cnd, DELETE))
+ if ((error = VOP_WHITEOUT(nd.ni_dvp, &nd.ni_cnd, DELETE)) != 0)
VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd);
vput(nd.ni_dvp);
ASSERT_VOP_UNLOCKED(nd.ni_dvp, "undelete");
@@ -1308,7 +1308,7 @@ unlink(p, uap)
struct nameidata nd;
NDINIT(&nd, DELETE, LOCKPARENT, UIO_USERSPACE, SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
vp = nd.ni_vp;
VOP_LEASE(vp, p, p->p_ucred, LEASE_WRITE);
@@ -1459,7 +1459,7 @@ access(p, uap)
cred->cr_groups[0] = p->p_cred->p_rgid;
NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | NOOBJ, UIO_USERSPACE,
SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
goto out1;
vp = nd.ni_vp;
@@ -1508,7 +1508,7 @@ ostat(p, uap)
NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | NOOBJ, UIO_USERSPACE,
SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
error = vn_stat(nd.ni_vp, &sb, p);
vput(nd.ni_vp);
@@ -1545,7 +1545,7 @@ olstat(p, uap)
NDINIT(&nd, LOOKUP, NOFOLLOW | LOCKLEAF | NOOBJ, UIO_USERSPACE,
SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
vp = nd.ni_vp;
error = vn_stat(vp, &sb, p);
@@ -1611,7 +1611,7 @@ stat(p, uap)
NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | NOOBJ, UIO_USERSPACE,
SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
error = vn_stat(nd.ni_vp, &sb, p);
vput(nd.ni_vp);
@@ -1646,7 +1646,7 @@ lstat(p, uap)
NDINIT(&nd, LOOKUP, NOFOLLOW | LOCKLEAF | NOOBJ, UIO_USERSPACE,
SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
vp = nd.ni_vp;
error = vn_stat(vp, &sb, p);
@@ -1701,7 +1701,7 @@ nstat(p, uap)
NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | NOOBJ, UIO_USERSPACE,
SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
error = vn_stat(nd.ni_vp, &sb, p);
vput(nd.ni_vp);
@@ -1738,7 +1738,7 @@ nlstat(p, uap)
NDINIT(&nd, LOOKUP, NOFOLLOW | LOCKLEAF | NOOBJ, UIO_USERSPACE,
SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
vp = nd.ni_vp;
error = vn_stat(vp, &sb, p);
@@ -1773,7 +1773,7 @@ pathconf(p, uap)
NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | NOOBJ, UIO_USERSPACE,
SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
error = VOP_PATHCONF(nd.ni_vp, SCARG(uap, name), p->p_retval);
vput(nd.ni_vp);
@@ -1808,7 +1808,7 @@ readlink(p, uap)
NDINIT(&nd, LOOKUP, NOFOLLOW | LOCKLEAF | NOOBJ, UIO_USERSPACE,
SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
vp = nd.ni_vp;
if (vp->v_type != VLNK)
@@ -1870,7 +1870,7 @@ chflags(p, uap)
struct nameidata nd;
NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
error = setfflags(p, nd.ni_vp, SCARG(uap, flags));
vrele(nd.ni_vp);
@@ -1898,7 +1898,7 @@ fchflags(p, uap)
struct file *fp;
int error;
- if (error = getvnode(p->p_fd, SCARG(uap, fd), &fp))
+ if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0)
return (error);
return setfflags(p, (struct vnode *) fp->f_data, SCARG(uap, flags));
}
@@ -1943,7 +1943,7 @@ chmod(p, uap)
struct nameidata nd;
NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
error = setfmode(p, nd.ni_vp, SCARG(uap, mode));
vrele(nd.ni_vp);
@@ -1972,7 +1972,7 @@ lchmod(p, uap)
struct nameidata nd;
NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
error = setfmode(p, nd.ni_vp, SCARG(uap, mode));
vrele(nd.ni_vp);
@@ -2000,7 +2000,7 @@ fchmod(p, uap)
struct file *fp;
int error;
- if (error = getvnode(p->p_fd, SCARG(uap, fd), &fp))
+ if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0)
return (error);
return setfmode(p, (struct vnode *)fp->f_data, SCARG(uap, mode));
}
@@ -2049,7 +2049,7 @@ chown(p, uap)
struct nameidata nd;
NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
error = setfown(p, nd.ni_vp, SCARG(uap, uid), SCARG(uap, gid));
vrele(nd.ni_vp);
@@ -2081,7 +2081,7 @@ lchown(p, uap)
struct nameidata nd;
NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
error = setfown(p, nd.ni_vp, SCARG(uap, uid), SCARG(uap, gid));
vrele(nd.ni_vp);
@@ -2111,7 +2111,7 @@ fchown(p, uap)
struct file *fp;
int error;
- if (error = getvnode(p->p_fd, SCARG(uap, fd), &fp))
+ if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0)
return (error);
return setfown(p, (struct vnode *)fp->f_data,
SCARG(uap, uid), SCARG(uap, gid));
@@ -2169,11 +2169,11 @@ utimes(p, uap)
microtime(&tv[0]);
tv[1] = tv[0];
nullflag = 1;
- } else if (error = copyin((caddr_t)SCARG(uap, tptr), (caddr_t)tv,
- sizeof (tv)))
+ } else if ((error = copyin((caddr_t)SCARG(uap, tptr), (caddr_t)tv,
+ sizeof (tv))) != 0)
return (error);
NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
error = setutimes(p, nd.ni_vp, tv, nullflag);
vrele(nd.ni_vp);
@@ -2208,11 +2208,11 @@ lutimes(p, uap)
microtime(&tv[0]);
tv[1] = tv[0];
nullflag = 1;
- } else if (error = copyin((caddr_t)SCARG(uap, tptr), (caddr_t)tv,
- sizeof (tv)))
+ } else if ((error = copyin((caddr_t)SCARG(uap, tptr), (caddr_t)tv,
+ sizeof (tv))) != 0)
return (error);
NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
error = setutimes(p, nd.ni_vp, tv, nullflag);
@@ -2248,11 +2248,11 @@ futimes(p, uap)
microtime(&tv[0]);
tv[1] = tv[0];
nullflag = 1;
- } else if (error = copyin((caddr_t)SCARG(uap, tptr), (caddr_t)tv,
- sizeof (tv)))
+ } else if ((error = copyin((caddr_t)SCARG(uap, tptr), (caddr_t)tv,
+ sizeof (tv))) != 0)
return (error);
- if (error = getvnode(p->p_fd, SCARG(uap, fd), &fp))
+ if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0)
return (error);
return setutimes(p, (struct vnode *)fp->f_data, tv, nullflag);
}
@@ -2285,7 +2285,7 @@ truncate(p, uap)
if (uap->length < 0)
return(EINVAL);
NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
vp = nd.ni_vp;
VOP_LEASE(vp, p, p->p_ucred, LEASE_WRITE);
@@ -2329,7 +2329,7 @@ ftruncate(p, uap)
if (uap->length < 0)
return(EINVAL);
- if (error = getvnode(p->p_fd, SCARG(uap, fd), &fp))
+ if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0)
return (error);
if ((fp->f_flag & FWRITE) == 0)
return (EINVAL);
@@ -2427,7 +2427,7 @@ fsync(p, uap)
struct file *fp;
int error;
- if (error = getvnode(p->p_fd, SCARG(uap, fd), &fp))
+ if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0)
return (error);
vp = (struct vnode *)fp->f_data;
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p);
@@ -2466,14 +2466,14 @@ rename(p, uap)
NDINIT(&fromnd, DELETE, WANTPARENT | SAVESTART, UIO_USERSPACE,
SCARG(uap, from), p);
- if (error = namei(&fromnd))
+ if ((error = namei(&fromnd)) != 0)
return (error);
fvp = fromnd.ni_vp;
NDINIT(&tond, RENAME, LOCKPARENT | LOCKLEAF | NOCACHE | SAVESTART | NOOBJ,
UIO_USERSPACE, SCARG(uap, to), p);
if (fromnd.ni_vp->v_type == VDIR)
tond.ni_cnd.cn_flags |= WILLBEDIR;
- if (error = namei(&tond)) {
+ if ((error = namei(&tond)) != 0) {
/* Translate error code for rename("dir1", "dir2/."). */
if (error == EISDIR && fvp->v_type == VDIR)
error = EINVAL;
@@ -2568,7 +2568,7 @@ mkdir(p, uap)
NDINIT(&nd, CREATE, LOCKPARENT, UIO_USERSPACE, SCARG(uap, path), p);
nd.ni_cnd.cn_flags |= WILLBEDIR;
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
vp = nd.ni_vp;
if (vp != NULL) {
@@ -2615,7 +2615,7 @@ rmdir(p, uap)
NDINIT(&nd, DELETE, LOCKPARENT | LOCKLEAF, UIO_USERSPACE,
SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
vp = nd.ni_vp;
if (vp->v_type != VDIR) {
@@ -2684,7 +2684,7 @@ ogetdirentries(p, uap)
int error, eofflag, readcnt;
long loff;
- if (error = getvnode(p->p_fd, SCARG(uap, fd), &fp))
+ if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0)
return (error);
if ((fp->f_flag & FREAD) == 0)
return (EBADF);
@@ -2798,7 +2798,7 @@ getdirentries(p, uap)
long loff;
int error, eofflag;
- if (error = getvnode(p->p_fd, SCARG(uap, fd), &fp))
+ if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0)
return (error);
if ((fp->f_flag & FREAD) == 0)
return (EBADF);
@@ -2906,14 +2906,14 @@ revoke(p, uap)
struct nameidata nd;
NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
vp = nd.ni_vp;
if (vp->v_type != VCHR && vp->v_type != VBLK) {
error = EINVAL;
goto out;
}
- if (error = VOP_GETATTR(vp, &vattr, p->p_ucred, p))
+ if ((error = VOP_GETATTR(vp, &vattr, p->p_ucred, p)) != 0)
goto out;
if (p->p_ucred->cr_uid != vattr.va_uid &&
(error = suser(p->p_ucred, &p->p_acflag)))
diff --git a/sys/sys/linker.h b/sys/sys/linker.h
index 2462a05..2c699fa 100644
--- a/sys/sys/linker.h
+++ b/sys/sys/linker.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: linker.h,v 1.11 1998/11/11 13:04:40 peter Exp $
+ * $Id: linker.h,v 1.12 1999/01/25 08:42:24 dfr Exp $
*/
#ifndef _SYS_LINKER_H_
@@ -43,7 +43,8 @@ MALLOC_DECLARE(M_LINKER);
typedef struct linker_file* linker_file_t;
typedef TAILQ_HEAD(, linker_file) linker_file_list_t;
-typedef caddr_t linker_sym_t; /* opaque symbol */
+typedef caddr_t linker_sym_t; /* opaque symbol */
+typedef c_caddr_t c_linker_sym_t; /* const opaque symbol */
/*
* expanded out linker_sym_t
diff --git a/sys/sys/malloc.h b/sys/sys/malloc.h
index 3b11123..87a856b 100644
--- a/sys/sys/malloc.h
+++ b/sys/sys/malloc.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)malloc.h 8.5 (Berkeley) 5/3/95
- * $Id: malloc.h,v 1.39 1999/01/21 08:29:08 dillon Exp $
+ * $Id: malloc.h,v 1.40 1999/01/21 09:23:21 dillon Exp $
*/
#ifndef _SYS_MALLOC_H_
@@ -162,7 +162,7 @@ struct kmembuckets {
*/
#define kmemxtob(alloc) (kmembase + (alloc) * PAGE_SIZE)
#define btokmemx(addr) (((caddr_t)(addr) - kmembase) / PAGE_SIZE)
-#define btokup(addr) (&kmemusage[(caddr_t)(addr) - kmembase >> PAGE_SHIFT])
+#define btokup(addr) (&kmemusage[((caddr_t)(addr) - kmembase) >> PAGE_SHIFT])
/*
* Macro versions for the usual cases of malloc/free
diff --git a/sys/sys/module.h b/sys/sys/module.h
index 3e0a000..c8d8557 100644
--- a/sys/sys/module.h
+++ b/sys/sys/module.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: module.h,v 1.6 1999/01/09 14:59:49 dfr Exp $
+ * $Id: module.h,v 1.7 1999/01/27 20:09:21 dillon Exp $
*/
#ifndef _SYS_MODULE_H_
@@ -37,7 +37,7 @@ typedef enum modeventtype {
typedef struct module *module_t;
-typedef int (*modeventhand_t)(module_t mod, modeventtype_t what,
+typedef int (*modeventhand_t)(module_t mod, int /*modeventtype_t*/ what,
void *arg);
/*
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index f5c54b1..9604690 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)vnode.h 8.7 (Berkeley) 2/4/94
- * $Id: vnode.h,v 1.79 1999/01/05 18:50:01 eivind Exp $
+ * $Id: vnode.h,v 1.80 1999/01/20 14:49:12 eivind Exp $
*/
#ifndef _SYS_VNODE_H_
@@ -422,12 +422,12 @@ struct vop_generic_args {
#define ASSERT_VOP_LOCKED(vp, str) \
if ((vp) && IS_LOCKING_VFS(vp) && !VOP_ISLOCKED(vp)) { \
- panic("%s: %x is not locked but should be", str, vp); \
+ panic("%s: %p is not locked but should be", str, vp); \
}
#define ASSERT_VOP_UNLOCKED(vp, str) \
if ((vp) && IS_LOCKING_VFS(vp) && VOP_ISLOCKED(vp)) { \
- panic("%s: %x is locked but shouldn't be", str, vp); \
+ panic("%s: %p is locked but shouldn't be", str, vp); \
}
#else
OpenPOWER on IntegriCloud