summaryrefslogtreecommitdiff
path: root/sys/compat/linux/common/linux_exec.c
diff options
context:
space:
mode:
authorjdolecek <jdolecek@NetBSD.org>2004-08-08 19:52:37 +0000
committerjdolecek <jdolecek@NetBSD.org>2004-08-08 19:52:37 +0000
commitb43cbaf291e00464c12479019c63f6e10da78bd2 (patch)
treeb3c265d938d5b4fe05c613297841ed250cdffefa /sys/compat/linux/common/linux_exec.c
parent7e7559f10519c74d11ef576f9556117cec607469 (diff)
fix two bugs in previous:
* flags passed from fork1() are FORK_*, not CLONE_*; thus, correct is to check for FORK_SHAREVM, not CLONE_VM * fix a reference counting bug
Diffstat (limited to 'sys/compat/linux/common/linux_exec.c')
-rw-r--r--sys/compat/linux/common/linux_exec.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/compat/linux/common/linux_exec.c b/sys/compat/linux/common/linux_exec.c
index 2f4d1f50adf..6b136579540 100644
--- a/sys/compat/linux/common/linux_exec.c
+++ b/sys/compat/linux/common/linux_exec.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_exec.c,v 1.71 2004/08/08 09:40:50 jdolecek Exp $ */
+/* $NetBSD: linux_exec.c,v 1.72 2004/08/08 19:52:37 jdolecek Exp $ */
/*-
* Copyright (c) 1994, 1995, 1998, 2000 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_exec.c,v 1.71 2004/08/08 09:40:50 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_exec.c,v 1.72 2004/08/08 19:52:37 jdolecek Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -159,14 +159,14 @@ linux_e_proc_init(p, parent, forkflags)
MALLOC(e, void *, sizeof(struct linux_emuldata),
M_EMULDATA, M_WAITOK);
} else {
- e->s->refs++;
+ e->s->refs--;
if (e->s->refs == 0)
FREE(e->s, M_EMULDATA);
}
memset(e, '\0', sizeof(struct linux_emuldata));
- if (forkflags & CLONE_VM) {
+ if (forkflags & FORK_SHAREVM) {
struct linux_emuldata *e2 = parent->p_emuldata;
s = e2->s;
s->refs++;