diff options
author | jhb <jhb@FreeBSD.org> | 2001-03-28 08:41:04 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2001-03-28 08:41:04 +0000 |
commit | 3aabb22260cdd728828c80d2439d1ba623be5a51 (patch) | |
tree | c056a169bcb495abb35eaa5c8794f971798d2edb /sys/kern/kern_sig.c | |
parent | 640834f7558f623ad0342c1a1afeb33ccd8e3586 (diff) | |
download | FreeBSD-src-3aabb22260cdd728828c80d2439d1ba623be5a51.zip FreeBSD-src-3aabb22260cdd728828c80d2439d1ba623be5a51.tar.gz |
- 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)
Diffstat (limited to 'sys/kern/kern_sig.c')
-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 b212359..3fb860e 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 */ } |