lkml.org 
[lkml]   [2019]   [Aug]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] /dev/mem: Bail out upon SIGKILL when reading memory.
On Tue, Aug 20, 2019 at 3:07 PM Tetsuo Handa
<penguin-kernel@i-love.sakura.ne.jp> wrote:
>
> - while (count > 0) {
> + while (count > 0 && !fatal_signal_pending(current)) {

Please just use the normal pattern of doing

if (fatal_signal_pending(current))
return -EINTR;

inside the loop instead.

(Ok, in this case I think it wants

err = -EINTR;
if (fatal_signal_pending(current))
break;

instead, but the point is to make it look like signal handling, just
with the special "fatal signals can sometimes be handled even when
regular signals might not make it through".

Linus

\
 
 \ /
  Last update: 2019-08-22 23:30    [W:0.150 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site