diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2002-11-06 00:17:29 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2002-11-06 00:17:29 +0000 |
commit | de4292869d583caed19f8d21c3e9ccee475357da (patch) | |
tree | 7958c0387bbcafc6637201216cc72b2f11a6d193 /sys/kern/sysv_shm.c | |
parent | 18f91d47d9735c52e8c411d33ddfd95db158838b (diff) |
Eliminate the use of KERN_SUCCESS outside of uvm/
Also uvm_map returns KERN_* codes that are directly mapped to
errnos, so we can return them instead of doing some attempt to
translation.
drahn@ "I see no problem" pval@ "makes sense"
Diffstat (limited to 'sys/kern/sysv_shm.c')
-rw-r--r-- | sys/kern/sysv_shm.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c index 7a0aa69fcf6..4dce0048b20 100644 --- a/sys/kern/sysv_shm.c +++ b/sys/kern/sysv_shm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sysv_shm.c,v 1.28 2002/10/29 18:30:21 art Exp $ */ +/* $OpenBSD: sysv_shm.c,v 1.29 2002/11/06 00:17:28 art Exp $ */ /* $NetBSD: sysv_shm.c,v 1.50 1998/10/21 22:24:29 tron Exp $ */ /* @@ -205,7 +205,6 @@ sys_shmat(p, v, retval) vaddr_t attach_va; vm_prot_t prot; vsize_t size; - int rv; shmmap_s = (struct shmmap_state *)p->p_vmspace->vm_shm; if (shmmap_s == NULL) { @@ -250,12 +249,11 @@ sys_shmat(p, v, retval) } shm_handle = shmseg->shm_internal; uao_reference(shm_handle->shm_object); - rv = uvm_map(&p->p_vmspace->vm_map, &attach_va, size, + error = uvm_map(&p->p_vmspace->vm_map, &attach_va, size, shm_handle->shm_object, 0, 0, UVM_MAPFLAG(prot, prot, UVM_INH_SHARE, UVM_ADV_RANDOM, 0)); - if (rv != KERN_SUCCESS) { - return ENOMEM; - } + if (error) + return (error); shmmap_s->va = attach_va; shmmap_s->shmid = SCARG(uap, shmid); |