diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-05-02 09:59:21 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-06-01 12:58:48 -0400 |
commit | b7f9a11a6cf1ea9ee6be3eb2b90d91327a09ad14 (patch) | |
tree | 7d5a5f469aea8ac2b3e1ab41e05a6abafcb2b694 /include | |
parent | 51a7b448d4134e3e8eec633435e3e8faee14a828 (diff) |
new helper: sigmask_to_save()
replace boilerplate "should we use ->saved_sigmask or ->blocked?"
with calls of obvious inlined helper...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/sched.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index f1b46b88f6f5..ded3fb63fb06 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -2213,6 +2213,14 @@ static inline void restore_saved_sigmask(void) | |||
2213 | set_current_blocked(¤t->saved_sigmask); | 2213 | set_current_blocked(¤t->saved_sigmask); |
2214 | } | 2214 | } |
2215 | 2215 | ||
2216 | static inline sigset_t *sigmask_to_save(void) | ||
2217 | { | ||
2218 | sigset_t *res = ¤t->blocked; | ||
2219 | if (unlikely(test_restore_sigmask())) | ||
2220 | res = ¤t->saved_sigmask; | ||
2221 | return res; | ||
2222 | } | ||
2223 | |||
2216 | static inline int kill_cad_pid(int sig, int priv) | 2224 | static inline int kill_cad_pid(int sig, int priv) |
2217 | { | 2225 | { |
2218 | return kill_pid(cad_pid, sig, priv); | 2226 | return kill_pid(cad_pid, sig, priv); |