summaryrefslogtreecommitdiff
path: root/sys/kern/sysv_shm.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/sysv_shm.c')
-rw-r--r--sys/kern/sysv_shm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c
index 9d1c0ccf2ef..5496b7908be 100644
--- a/sys/kern/sysv_shm.c
+++ b/sys/kern/sysv_shm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysv_shm.c,v 1.49 2007/09/15 10:10:37 martin Exp $ */
+/* $OpenBSD: sysv_shm.c,v 1.50 2009/06/02 12:11:16 guenther Exp $ */
/* $NetBSD: sysv_shm.c,v 1.50 1998/10/21 22:24:29 tron Exp $ */
/*
@@ -280,7 +280,7 @@ sys_shmat(struct proc *p, void *v, register_t *retval)
shmmap_s->va = attach_va;
shmmap_s->shmid = SCARG(uap, shmid);
- shmseg->shm_lpid = p->p_pid;
+ shmseg->shm_lpid = p->p_p->ps_mainproc->p_pid;
shmseg->shm_atime = time_second;
shmseg->shm_nattch++;
*retval = attach_va;
@@ -445,7 +445,7 @@ shmget_allocate_segment(struct proc *p,
shmseg->shm_perm.seq = shmseqs[segnum] = (shmseqs[segnum] + 1) & 0x7fff;
shmseg->shm_perm.key = key;
shmseg->shm_segsz = SCARG(uap, size);
- shmseg->shm_cpid = p->p_pid;
+ shmseg->shm_cpid = p->p_p->ps_mainproc->p_pid;
shmseg->shm_lpid = shmseg->shm_nattch = 0;
shmseg->shm_atime = shmseg->shm_dtime = 0;
shmseg->shm_ctime = time_second;