From f6022b25f901b35b6563820a75aae00925b68635 Mon Sep 17 00:00:00 2001 From: matthew Date: Sat, 12 Jul 2014 21:21:19 +0000 Subject: Refactor out dosigsuspend() function Discussed with guenther and kettenis --- sys/kern/sys_generic.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'sys/kern/sys_generic.c') diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index b94b7dd4f8f..63d2ccb58d2 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_generic.c,v 1.89 2014/07/12 18:43:32 tedu Exp $ */ +/* $OpenBSD: sys_generic.c,v 1.90 2014/07/12 21:21:19 matthew Exp $ */ /* $NetBSD: sys_generic.c,v 1.24 1996/03/29 00:25:32 cgd Exp $ */ /* @@ -657,11 +657,8 @@ dopselect(struct proc *p, int nd, fd_set *in, fd_set *ou, fd_set *ex, } timo = 0; - if (sigmask) { - p->p_oldmask = p->p_sigmask; - atomic_setbits_int(&p->p_flag, P_SIGSUSPEND); - p->p_sigmask = *sigmask &~ sigcantmask; - } + if (sigmask) + dosigsuspend(p, *sigmask &~ sigcantmask); retry: ncoll = nselcoll; @@ -965,11 +962,8 @@ doppoll(struct proc *p, struct pollfd *fds, u_int nfds, } timo = 0; - if (sigmask) { - p->p_oldmask = p->p_sigmask; - atomic_setbits_int(&p->p_flag, P_SIGSUSPEND); - p->p_sigmask = *sigmask &~ sigcantmask; - } + if (sigmask) + dosigsuspend(p, *sigmask &~ sigcantmask); retry: ncoll = nselcoll; -- cgit v1.2.3-59-g8ed1b