aboutsummaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorMatthew Dillon <dillon@FreeBSD.org>1999-01-27 21:50:00 +0000
committerMatthew Dillon <dillon@FreeBSD.org>1999-01-27 21:50:00 +0000
commitd254af07a14b8ea8891c2369150729943aa142df (patch)
tree2f1d801e18eaabd9c7650b3093c05f623b35ce3e /sys/kern
parent598217c491a12a9ff390d11f4f469a8444c52e20 (diff)
Notes
Diffstat (limited to 'sys/kern')
-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
25 files changed, 240 insertions, 240 deletions
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c
index 56f9d621d62b..a719abb9dd6c 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 df832f63fb7f..e47459b4f0f9 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 dd6367203579..2f3684874595 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 2cd51428a8f5..65457411e2b9 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 e5ea6297398d..74e8a7f9fa57 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 cc1b8a562f20..6e26959a8e08 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 04ca1058f92c..d3939b8f9ab7 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 afe9f2e2de78..ce82661804ca 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 c5ceeae7e27a..3d8947ff92dd 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 2bd17bb6bdcb..b5f0640d4c13 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 3d8671302617..ffc38f09a964 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 3d8671302617..ffc38f09a964 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 dc4c88a22912..283dd607b873 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 8d90ee9bdc2e..8d745f47849f 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 c0190d27d7a4..6deefed3de88 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 475612703965..51545e653e6e 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 ba71a949fb3b..686aa271469f 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 77a43317e64f..9e953da7a647 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 e23373c4744f..6909958e0491 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 c1af873b04e3..08ebd8570232 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 5d3b1ff58fd8..751115977282 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 781508e20253..27e9167d83cf 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 9b444fc5122c..548b4807a2ef 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 67efd523706d..30b28a7dbc3e 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 9b444fc5122c..548b4807a2ef 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)))