diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-05-21 21:42:32 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-05-21 23:52:30 -0400 |
commit | 68f3f16d9ad0f1e28ab3fd0001ab5798c41f15a3 (patch) | |
tree | fd023109413f5eb28b364663fdf4bf2eabca47d4 /arch/sparc/kernel | |
parent | bf67f3a5c456a18f2e8d062f7e88506ef2cd9837 (diff) |
new helper: sigsuspend()
guts of saved_sigmask-based sigsuspend/rt_sigsuspend. Takes
kernel sigset_t *.
Open-coded instances replaced with calling it.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/sparc/kernel')
-rw-r--r-- | arch/sparc/kernel/signal_32.c | 12 | ||||
-rw-r--r-- | arch/sparc/kernel/signal_64.c | 13 |
2 files changed, 2 insertions, 23 deletions
diff --git a/arch/sparc/kernel/signal_32.c b/arch/sparc/kernel/signal_32.c index ac8e66b50f07..2b7e849f7c65 100644 --- a/arch/sparc/kernel/signal_32.c +++ b/arch/sparc/kernel/signal_32.c | |||
@@ -64,18 +64,8 @@ struct rt_signal_frame { | |||
64 | static int _sigpause_common(old_sigset_t set) | 64 | static int _sigpause_common(old_sigset_t set) |
65 | { | 65 | { |
66 | sigset_t blocked; | 66 | sigset_t blocked; |
67 | |||
68 | current->saved_sigmask = current->blocked; | ||
69 | |||
70 | set &= _BLOCKABLE; | ||
71 | siginitset(&blocked, set); | 67 | siginitset(&blocked, set); |
72 | set_current_blocked(&blocked); | 68 | return sigsuspend(&blocked); |
73 | |||
74 | current->state = TASK_INTERRUPTIBLE; | ||
75 | schedule(); | ||
76 | set_thread_flag(TIF_RESTORE_SIGMASK); | ||
77 | |||
78 | return -ERESTARTNOHAND; | ||
79 | } | 69 | } |
80 | 70 | ||
81 | asmlinkage int sys_sigsuspend(old_sigset_t set) | 71 | asmlinkage int sys_sigsuspend(old_sigset_t set) |
diff --git a/arch/sparc/kernel/signal_64.c b/arch/sparc/kernel/signal_64.c index 48b0f57b65f7..eafaab486b2d 100644 --- a/arch/sparc/kernel/signal_64.c +++ b/arch/sparc/kernel/signal_64.c | |||
@@ -242,19 +242,8 @@ struct rt_signal_frame { | |||
242 | static long _sigpause_common(old_sigset_t set) | 242 | static long _sigpause_common(old_sigset_t set) |
243 | { | 243 | { |
244 | sigset_t blocked; | 244 | sigset_t blocked; |
245 | |||
246 | current->saved_sigmask = current->blocked; | ||
247 | |||
248 | set &= _BLOCKABLE; | ||
249 | siginitset(&blocked, set); | 245 | siginitset(&blocked, set); |
250 | set_current_blocked(&blocked); | 246 | return sigsuspend(&blocked); |
251 | |||
252 | current->state = TASK_INTERRUPTIBLE; | ||
253 | schedule(); | ||
254 | |||
255 | set_restore_sigmask(); | ||
256 | |||
257 | return -ERESTARTNOHAND; | ||
258 | } | 247 | } |
259 | 248 | ||
260 | asmlinkage long sys_sigpause(unsigned int set) | 249 | asmlinkage long sys_sigpause(unsigned int set) |