signal: cleanup sys_rt_sigprocmask()
authorOleg Nesterov <oleg@redhat.com>
Wed, 27 Apr 2011 19:18:10 +0000 (21:18 +0200)
committerOleg Nesterov <oleg@redhat.com>
Thu, 28 Apr 2011 11:01:38 +0000 (13:01 +0200)
commitbb7efee2ca63b08795ffb3cda96fc89d2e641b79
tree05e05d78f815d9fb8f8963860d2287189a17d7b1
parente9bd3f0faa90084f188830d77723bafe422e486b
signal: cleanup sys_rt_sigprocmask()

sys_rt_sigprocmask() looks unnecessarily complicated, simplify it.
We can just read current->blocked lockless unconditionally before
anything else and then copy-to-user it if needed.  At worst we
copy 4 words on mips.

We could copy-to-user the old mask first and simplify the code even
more, but the patch tries to keep the current behaviour: we change
current->block even if copy_to_user(oset) fails.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: Matt Fleming <matt.fleming@linux.intel.com>
Acked-by: Tejun Heo <tj@kernel.org>
kernel/signal.c