commit 60ee4408bea049a2d1d711d021ffc4ac882de942
parent 72a590d60a4aed5077e4dbb296aedbecbf69f976
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Mon, 30 Jul 2018 20:22:24 +0200
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>
Diffstat:
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git 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. */