summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_exit.c
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2013-06-01 04:05:26 +0000
committertedu <tedu@openbsd.org>2013-06-01 04:05:26 +0000
commit5636a1d2ee0e01a2d804948f1756be75737d3371 (patch)
tree6f968fb9a11b6b62cd50e5234c65da6a41502092 /sys/kern/kern_exit.c
parentMake mutexes that get used in interrupts IPL_TTY instead of IPL_NONE. (diff)
downloadwireguard-openbsd-5636a1d2ee0e01a2d804948f1756be75737d3371.tar.xz
wireguard-openbsd-5636a1d2ee0e01a2d804948f1756be75737d3371.zip
some small style changes that are distracting me from seeing a real bug
Diffstat (limited to '')
-rw-r--r--sys/kern/kern_exit.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index 5cccf33867e..a9acc650ac5 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_exit.c,v 1.123 2013/05/07 19:26:25 guenther Exp $ */
+/* $OpenBSD: kern_exit.c,v 1.124 2013/06/01 04:05:26 tedu Exp $ */
/* $NetBSD: kern_exit.c,v 1.39 1996/04/22 01:38:25 christos Exp $ */
/*
@@ -98,9 +98,8 @@ sys___threxit(struct proc *p, void *v, register_t *retval)
if (SCARG(uap, notdead) != NULL) {
pid_t zero = 0;
- if (copyout(&zero, SCARG(uap, notdead), sizeof(zero))) {
+ if (copyout(&zero, SCARG(uap, notdead), sizeof(zero)))
psignal(p, SIGSEGV);
- }
}
exit1(p, 0, EXIT_THREAD);
@@ -129,9 +128,9 @@ exit1(struct proc *p, int rv, int flags)
/* single-threaded? */
if (TAILQ_FIRST(&pr->ps_threads) == p &&
- TAILQ_NEXT(p, p_thr_link) == NULL)
+ TAILQ_NEXT(p, p_thr_link) == NULL) {
flags = EXIT_NORMAL;
- else {
+ } else {
/* nope, multi-threaded */
if (flags == EXIT_NORMAL)
single_thread_set(p, SINGLE_EXIT, 0);
@@ -159,20 +158,20 @@ exit1(struct proc *p, int rv, int flags)
TAILQ_REMOVE(&pr->ps_threads, p, p_thr_link);
if ((p->p_flag & P_THREAD) == 0) {
/* main thread gotta wait because it has the pid, et al */
- while (! TAILQ_EMPTY(&pr->ps_threads))
+ while (!TAILQ_EMPTY(&pr->ps_threads))
tsleep(&pr->ps_threads, PUSER, "thrdeath", 0);
if (pr->ps_flags & PS_PROFIL)
stopprofclock(pr);
- } else if (TAILQ_EMPTY(&pr->ps_threads))
+ } else if (TAILQ_EMPTY(&pr->ps_threads)) {
wakeup(&pr->ps_threads);
+ }
rup = pr->ps_ru;
if (rup == NULL) {
rup = pool_get(&rusage_pool, PR_WAITOK | PR_ZERO);
-
- if (pr->ps_ru == NULL)
+ if (pr->ps_ru == NULL) {
pr->ps_ru = rup;
- else {
+ } else {
pool_put(&rusage_pool, rup);
rup = pr->ps_ru;
}
@@ -205,7 +204,7 @@ exit1(struct proc *p, int rv, int flags)
if (sp->s_ttyp->t_pgrp)
pgsignal(sp->s_ttyp->t_pgrp,
SIGHUP, 1);
- (void) ttywait(sp->s_ttyp);
+ ttywait(sp->s_ttyp);
/*
* The tty could have been revoked
* if we blocked.
@@ -230,7 +229,7 @@ exit1(struct proc *p, int rv, int flags)
fixjobc(pr, pr->ps_pgrp, 0);
#ifdef ACCOUNTING
- (void)acct_process(p);
+ acct_process(p);
#endif
#ifdef KTRACE