summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2001-05-15 23:13:58 +0000
committerjhb <jhb@FreeBSD.org>2001-05-15 23:13:58 +0000
commit36dcd7aa2fee5c973cc58fcbd508631d333fb4aa (patch)
treec3ecf22fbb19de3650ce7d691f70ca4ab9a0c1c2 /sys
parentb5845858e63130ea0deceb47fe1edf06c9ffd3fe (diff)
downloadFreeBSD-src-36dcd7aa2fee5c973cc58fcbd508631d333fb4aa.zip
FreeBSD-src-36dcd7aa2fee5c973cc58fcbd508631d333fb4aa.tar.gz
- Remove unneeded include of sys/ipl.h.
- Require the proc lock be held for killproc() to allow for the vmdaemon to kill a process when memory is exhausted while holding the lock of the process to kill.
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_sig.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index 55da023..56837f4 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -54,7 +54,6 @@
#include <sys/pioctl.h>
#include <sys/acct.h>
#include <sys/fcntl.h>
-#include <sys/ipl.h>
#include <sys/condvar.h>
#include <sys/lock.h>
#include <sys/mutex.h>
@@ -1608,13 +1607,13 @@ killproc(p, why)
struct proc *p;
char *why;
{
+
+ PROC_LOCK_ASSERT(p, MA_OWNED);
CTR3(KTR_PROC, "killproc: proc %p (pid %d, %s)",
p, p->p_pid, p->p_comm);
log(LOG_ERR, "pid %d (%s), uid %d, was killed: %s\n", p->p_pid, p->p_comm,
p->p_cred && p->p_ucred ? p->p_ucred->cr_uid : -1, why);
- PROC_LOCK(p);
psignal(p, SIGKILL);
- PROC_UNLOCK(p);
}
/*
OpenPOWER on IntegriCloud