Module Name: src Committed By: kamil Date: Mon Jan 9 00:31:30 UTC 2017
Modified Files: src/sys/kern: kern_exec.c kern_exit.c kern_fork.c Log Message: Cleanup dead code after revert of racy vfork(2) commit This removes dead code introduced with the following commit: date: 2012-07-27 22:52:49 +0200; author: christos; state: Exp; lines: +8 -2; revert racy vfork() parent-blocking-before-child-execs-or-exits code. ok rmind To generate a diff of this commit: cvs rdiff -u -r1.439 -r1.440 src/sys/kern/kern_exec.c cvs rdiff -u -r1.267 -r1.268 src/sys/kern/kern_exit.c cvs rdiff -u -r1.196 -r1.197 src/sys/kern/kern_fork.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/kern/kern_exec.c diff -u src/sys/kern/kern_exec.c:1.439 src/sys/kern/kern_exec.c:1.440 --- src/sys/kern/kern_exec.c:1.439 Fri Jan 6 22:42:58 2017 +++ src/sys/kern/kern_exec.c Mon Jan 9 00:31:30 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_exec.c,v 1.439 2017/01/06 22:42:58 kamil Exp $ */ +/* $NetBSD: kern_exec.c,v 1.440 2017/01/09 00:31:30 kamil Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.439 2017/01/06 22:42:58 kamil Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.440 2017/01/09 00:31:30 kamil Exp $"); #include "opt_exec.h" #include "opt_execfmt.h" @@ -1235,26 +1235,11 @@ execve_runproc(struct lwp *l, struct exe * exited and exec()/exit() are the only places it will be cleared. */ if ((p->p_lflag & PL_PPWAIT) != 0) { -#if 0 - lwp_t *lp; - - mutex_enter(proc_lock); - lp = p->p_vforklwp; - p->p_vforklwp = NULL; - - l->l_lwpctl = NULL; /* was on loan from blocked parent */ - p->p_lflag &= ~PL_PPWAIT; - - lp->l_pflag &= ~LP_VFORKWAIT; /* XXX */ - cv_broadcast(&lp->l_waitcv); - mutex_exit(proc_lock); -#else mutex_enter(proc_lock); l->l_lwpctl = NULL; /* was on loan from blocked parent */ p->p_lflag &= ~PL_PPWAIT; cv_broadcast(&p->p_pptr->p_waitcv); mutex_exit(proc_lock); -#endif } error = credexec(l, &data->ed_attr); Index: src/sys/kern/kern_exit.c diff -u src/sys/kern/kern_exit.c:1.267 src/sys/kern/kern_exit.c:1.268 --- src/sys/kern/kern_exit.c:1.267 Sun Nov 13 15:25:01 2016 +++ src/sys/kern/kern_exit.c Mon Jan 9 00:31:30 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_exit.c,v 1.267 2016/11/13 15:25:01 christos Exp $ */ +/* $NetBSD: kern_exit.c,v 1.268 2017/01/09 00:31:30 kamil Exp $ */ /*- * Copyright (c) 1998, 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -67,7 +67,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.267 2016/11/13 15:25:01 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.268 2017/01/09 00:31:30 kamil Exp $"); #include "opt_ktrace.h" #include "opt_dtrace.h" @@ -343,21 +343,9 @@ exit1(struct lwp *l, int exitcode, int s */ mutex_enter(proc_lock); if (p->p_lflag & PL_PPWAIT) { -#if 0 - lwp_t *lp; - - l->l_lwpctl = NULL; /* was on loan from blocked parent */ - p->p_lflag &= ~PL_PPWAIT; - - lp = p->p_vforklwp; - p->p_vforklwp = NULL; - lp->l_pflag &= ~LP_VFORKWAIT; /* XXX */ - cv_broadcast(&lp->l_waitcv); -#else l->l_lwpctl = NULL; /* was on loan from blocked parent */ p->p_lflag &= ~PL_PPWAIT; cv_broadcast(&p->p_pptr->p_waitcv); -#endif } if (SESS_LEADER(p)) { Index: src/sys/kern/kern_fork.c diff -u src/sys/kern/kern_fork.c:1.196 src/sys/kern/kern_fork.c:1.197 --- src/sys/kern/kern_fork.c:1.196 Fri Nov 4 18:14:04 2016 +++ src/sys/kern/kern_fork.c Mon Jan 9 00:31:30 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_fork.c,v 1.196 2016/11/04 18:14:04 christos Exp $ */ +/* $NetBSD: kern_fork.c,v 1.197 2017/01/09 00:31:30 kamil Exp $ */ /*- * Copyright (c) 1999, 2001, 2004, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -67,7 +67,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_fork.c,v 1.196 2016/11/04 18:14:04 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_fork.c,v 1.197 2017/01/09 00:31:30 kamil Exp $"); #include "opt_ktrace.h" #include "opt_dtrace.h" @@ -570,14 +570,8 @@ fork1(struct lwp *l1, int flags, int exi * Preserve synchronization semantics of vfork. If waiting for * child to exec or exit, sleep until it clears LP_VFORKWAIT. */ -#if 0 - while (l1->l_pflag & LP_VFORKWAIT) { - cv_wait(&l1->l_waitcv, proc_lock); - } -#else while (p2->p_lflag & PL_PPWAIT) cv_wait(&p1->p_waitcv, proc_lock); -#endif /* * Let the parent know that we are tracing its child.