summaryrefslogtreecommitdiff
path: root/sys/kern/sysv_shm.c
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2001-12-19 08:58:08 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2001-12-19 08:58:08 +0000
commitd8afae924f4db99650aa0df115c6ae66ed02b950 (patch)
treea2cbc045f0eb624a394f8e45fea1a58ecf1faaf0 /sys/kern/sysv_shm.c
parent4a6c79ff4f05aaae32458104529a9a9e0d3d208b (diff)
UBC was a disaster. It worked very good when it worked, but on some
machines or some configurations or in some phase of the moon (we actually don't know when or why) files disappeared. Since we've not been able to track down the problem in two weeks intense debugging and we need -current to be stable, back out everything to a state it had before UBC. We apologise for the inconvenience.
Diffstat (limited to 'sys/kern/sysv_shm.c')
-rw-r--r--sys/kern/sysv_shm.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c
index 817d7512b6c..d787fde7c5b 100644
--- a/sys/kern/sysv_shm.c
+++ b/sys/kern/sysv_shm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysv_shm.c,v 1.23 2001/11/28 13:47:39 art Exp $ */
+/* $OpenBSD: sysv_shm.c,v 1.24 2001/12/19 08:58:06 art Exp $ */
/* $NetBSD: sysv_shm.c,v 1.50 1998/10/21 22:24:29 tron Exp $ */
/*
@@ -144,13 +144,15 @@ shm_delete_mapping(vm, shmmap_s)
struct shmmap_state *shmmap_s;
{
struct shmid_ds *shmseg;
- int segnum;
+ int segnum, result;
size_t size;
segnum = IPCID_TO_IX(shmmap_s->shmid);
shmseg = &shmsegs[segnum];
size = round_page(shmseg->shm_segsz);
- uvm_deallocate(&vm->vm_map, shmmap_s->va, size);
+ result = uvm_deallocate(&vm->vm_map, shmmap_s->va, size);
+ if (result != KERN_SUCCESS)
+ return EINVAL;
shmmap_s->shmid = -1;
shmseg->shm_dtime = time.tv_sec;
if ((--shmseg->shm_nattch <= 0) &&
@@ -205,6 +207,7 @@ 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) {
@@ -249,11 +252,11 @@ sys_shmat(p, v, retval)
}
shm_handle = shmseg->shm_internal;
uao_reference(shm_handle->shm_object);
- error = uvm_map(&p->p_vmspace->vm_map, &attach_va, size,
+ rv = 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 (error) {
- return error;
+ if (rv != KERN_SUCCESS) {
+ return ENOMEM;
}
shmmap_s->va = attach_va;