Commit 6527de95 authored by Christian Brauner's avatar Christian Brauner Committed by Linus Torvalds

signal: make may_ptrace_stop() return bool

may_ptrace_stop() already behaves like a boolean function.  Let's actually
declare it as such too.

Link: http://lkml.kernel.org/r/20180602103653.18181-4-christian@brauner.ioSigned-off-by: default avatarChristian Brauner <christian@brauner.io>
Reviewed-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: James Morris <james.morris@microsoft.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent bb17fcca
...@@ -1875,10 +1875,10 @@ static void do_notify_parent_cldstop(struct task_struct *tsk, ...@@ -1875,10 +1875,10 @@ static void do_notify_parent_cldstop(struct task_struct *tsk,
spin_unlock_irqrestore(&sighand->siglock, flags); spin_unlock_irqrestore(&sighand->siglock, flags);
} }
static inline int may_ptrace_stop(void) static inline bool may_ptrace_stop(void)
{ {
if (!likely(current->ptrace)) if (!likely(current->ptrace))
return 0; return false;
/* /*
* Are we in the middle of do_coredump? * Are we in the middle of do_coredump?
* If so and our tracer is also part of the coredump stopping * If so and our tracer is also part of the coredump stopping
...@@ -1894,9 +1894,9 @@ static inline int may_ptrace_stop(void) ...@@ -1894,9 +1894,9 @@ static inline int may_ptrace_stop(void)
*/ */
if (unlikely(current->mm->core_state) && if (unlikely(current->mm->core_state) &&
unlikely(current->mm == current->parent->mm)) unlikely(current->mm == current->parent->mm))
return 0; return false;
return 1; return true;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment