]> gcc.gnu.org Git - gcc.git/commit
[Ada] sigaction result not properly checked in __gnat_install_handler (QNX)
authorJoel Brobecker <brobecker@adacore.com>
Fri, 11 Mar 2022 03:39:53 +0000 (03:39 +0000)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 16 May 2022 08:42:05 +0000 (08:42 +0000)
commit1bdf9fa390282299418e21534674d0ab252e9f34
tree02ff1961a5bac943712a12ac88dd423e8766b565
parent839e7f16abda3fd8bd46d59ff1521d402d328a24
[Ada] sigaction result not properly checked in __gnat_install_handler (QNX)

The QNX version of __gnat_install_handler calls sigaction for a number
of signals, and then prints an error message when the the call failed.
But unfortunately, except for the first call, we forgot to store
sigaction's return value, so the check that ensues uses a potentially
uninitialized variable, which the compiler does detect (this is how we
found this issue).

This change fixes this by make sure we store the result of each
sigaction call before checking it.

While at it, we noticed a thinko in the error messages all alerting
about the SIGFPE signal, rather than the signal it just tested.  Most
likely a copy/paste thinko. Fixed by this change as well.

gcc/ada/

* init.c (__gnat_install_handler) [__QNX__]: Save sigaction's
return value in err before checking err's value.  Fix incorrect
signal names in perror messages.
gcc/ada/init.c
This page took 0.058384 seconds and 5 git commands to generate.