diff options
author | John Baldwin <jhb@FreeBSD.org> | 2001-03-28 08:41:04 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2001-03-28 08:41:04 +0000 |
commit | c31146a14e393cecdf6697f5dd3bf110597623e2 (patch) | |
tree | e2083ef79ad9844f55e21fefedd5970222cb5783 /sys | |
parent | 5ecf40428d46cbacf118e85c153ca6fbb077d0fa (diff) | |
download | src-c31146a14e393cecdf6697f5dd3bf110597623e2.tar.gz src-c31146a14e393cecdf6697f5dd3bf110597623e2.zip |
- Resort some includes to deal with the new witness code coming in shortly.
- Make sure we have Giant locked before calling coredump() in sigexit().
Spotted by: peter (2)
Notes
Notes:
svn path=/head/; revision=74911
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_sig.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index b2123595fc88..3fb860e497a9 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -47,7 +47,6 @@ #include <sys/sysproto.h> #include <sys/systm.h> #include <sys/signalvar.h> -#include <sys/resourcevar.h> #include <sys/namei.h> #include <sys/vnode.h> #include <sys/event.h> @@ -57,10 +56,12 @@ #include <sys/fcntl.h> #include <sys/ipl.h> #include <sys/condvar.h> +#include <sys/lock.h> #include <sys/mutex.h> #include <sys/wait.h> #include <sys/ktr.h> #include <sys/ktrace.h> +#include <sys/resourcevar.h> #include <sys/syslog.h> #include <sys/stat.h> #include <sys/sysent.h> @@ -1657,6 +1658,8 @@ sigexit(p, sig) * XXX : Todo, as well as euid, write out ruid too */ PROC_UNLOCK(p); + if (!mtx_owned(&Giant)) + mtx_lock(&Giant); if (coredump(p) == 0) sig |= WCOREFLAG; if (kern_logsigexit) @@ -1666,10 +1669,11 @@ sigexit(p, sig) p->p_cred && p->p_ucred ? p->p_ucred->cr_uid : -1, sig &~ WCOREFLAG, sig & WCOREFLAG ? " (core dumped)" : ""); - } else + } else { PROC_UNLOCK(p); - if (!mtx_owned(&Giant)) - mtx_lock(&Giant); + if (!mtx_owned(&Giant)) + mtx_lock(&Giant); + } exit1(p, W_EXITCODE(0, sig)); /* NOTREACHED */ } |