From 60ee4408bea049a2d1d711d021ffc4ac882de942 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Mon, 30 Jul 2018 20:22:24 +0200 Subject: [PATCH] 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 --- src/text.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/text.c b/src/text.c index e5c739b8..99eaa512 100644 --- a/src/text.c +++ b/src/text.c @@ -1088,12 +1088,10 @@ void do_enter(void) } #ifndef NANO_TINY -/* Send a SIGKILL (unconditional kill) to the forked process in - * execute_command(). */ +/* Send an unconditional kill signal to the running external command. */ RETSIGTYPE cancel_the_command(int signal) { - if (kill(pid_of_command, SIGKILL) == -1) - nperror("kill"); + kill(pid_of_command, SIGKILL); } /* Send the text that starts at the given line to file descriptor fd. */