summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-05-21 23:33:55 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-06-01 12:58:47 -0400
commit51a7b448d4134e3e8eec633435e3e8faee14a828 (patch)
tree8fc58560ffee1c944ec5e198029d5c2e6f7c0bd3 /include
parent4ebefe3ec729003443daf153ed6fad1739271283 (diff)
new helper: restore_saved_sigmask()
first fruits of ..._restore_sigmask() helpers: now we can take boilerplate "signal didn't have a handler, clear RESTORE_SIGMASK and restore the blocked mask from ->saved_mask" into a common helper. Open-coded instances switched... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include')
-rw-r--r--include/linux/sched.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 660c8ae93471..f1b46b88f6f5 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -2207,6 +2207,12 @@ extern int send_sigqueue(struct sigqueue *, struct task_struct *, int group);
extern int do_sigaction(int, struct k_sigaction *, struct k_sigaction *);
extern int do_sigaltstack(const stack_t __user *, stack_t __user *, unsigned long);
+static inline void restore_saved_sigmask(void)
+{
+ if (test_and_clear_restore_sigmask())
+ set_current_blocked(&current->saved_sigmask);
+}
+
static inline int kill_cad_pid(int sig, int priv)
{
return kill_pid(cad_pid, sig, priv);