signals: don't call a print routine in a signal handler
Print routines are not asynchronous-safe. But... the only reason the call of kill() could return an error code is when the relevant process has already terminated -- which is not a problem, because that was the goal of calling kill(). This fixes https://savannah.gnu.org/bugs/?54409. Reported-by: Daniel Kozovsky <dkozovsk@redhat.com>master
parent
72a590d60a
commit
60ee4408be
|
@ -1088,12 +1088,10 @@ void do_enter(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
/* Send a SIGKILL (unconditional kill) to the forked process in
|
/* Send an unconditional kill signal to the running external command. */
|
||||||
* execute_command(). */
|
|
||||||
RETSIGTYPE cancel_the_command(int signal)
|
RETSIGTYPE cancel_the_command(int signal)
|
||||||
{
|
{
|
||||||
if (kill(pid_of_command, SIGKILL) == -1)
|
kill(pid_of_command, SIGKILL);
|
||||||
nperror("kill");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Send the text that starts at the given line to file descriptor fd. */
|
/* Send the text that starts at the given line to file descriptor fd. */
|
||||||
|
|
Loading…
Reference in New Issue