[Ada] Fix exit status of GNAT.Expect.Close call on running process
authorDmitriy Anisimkov <anisimko@adacore.com>
Wed, 15 Dec 2021 13:26:50 +0000 (19:26 +0600)
committerPierre-Marie de Rodat <derodat@adacore.com>
Fri, 7 Jan 2022 16:24:10 +0000 (16:24 +0000)
commit9e6274e0a3b60e77a42784c3fb6ef2aa3cfc071a
tree7366e040405074b954c1650a1e9b0f3f7a6fb15b
parent69a6631a6ff0074083da528e3eec7dbf4997a609
[Ada] Fix exit status of GNAT.Expect.Close call on running process

gcc/ada/

* expect.c (__gnat_waitpid): Use macros WIFEXITED, WEXITSTATUS,
WIFSIGNALED, WTERMSIG, WIFSTOPPED, WSTOPSIG to get exit status
or signal that caused the child process to terminate/stop.  Do
not process exit status in case of error in waitpid call.
* adaint.c (__gnat_kill): Use of GenerateConsoleCtrlEvent is
removed in Windows variant as it actually is not working and was
terminating the calling process.  Set signal number into exit
code parameter of TerminateProcess to work the same like in
Linux.
gcc/ada/adaint.c
gcc/ada/expect.c