[Ada] Raise exception on call to Expect for a dead process
authorVadim Godunko <godunko@adacore.com>
Wed, 18 Sep 2019 08:32:14 +0000 (08:32 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Wed, 18 Sep 2019 08:32:14 +0000 (08:32 +0000)
commit209a0094c4b1a8603b73beb77f28ea6c314d5875
tree890a80dff58179628c4d5596de07ec29b59c6ac7
parent82fa20a21141a1394d7188b21eb9c486ab16f8ea
[Ada] Raise exception on call to Expect for a dead process

Call to Expect for a dead process results in SIGBUS signal on Linux
systems. Process_Died exception is raised in this case now.

2019-09-18  Vadim Godunko  <godunko@adacore.com>

gcc/ada/

* libgnat/g-expect.adb (Expect_Internal): Don't include invalid
file descriptors into the set of file descriptors for Poll.
Raise Process_Died exception when computed set of file
descriptors to monitor is empty.

gcc/testsuite/

* gnat.dg/expect4.adb: New testcase.

From-SVN: r275847
gcc/ada/ChangeLog
gcc/ada/libgnat/g-expect.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/expect4.adb [new file with mode: 0644]