From: Dmitriy Anisimkov Date: Mon, 8 Jul 2019 08:14:50 +0000 (+0000) Subject: [Ada] Os_Lib: do not call __gnat_kill for Invalid_Pid X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3a4a60d1d2303f51ea0ed442aa38cc5a9a4201c5;p=gcc.git [Ada] Os_Lib: do not call __gnat_kill for Invalid_Pid 2019-07-08 Dmitriy Anisimkov gcc/ada/ * libgnat/s-os_lib.adb: Do not call __gnat_kill for Invalid_Pid. From-SVN: r273223 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index d38dce0f9eb..672ac82b9ff 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,7 @@ +2019-07-08 Dmitriy Anisimkov + + * libgnat/s-os_lib.adb: Do not call __gnat_kill for Invalid_Pid. + 2019-07-08 Piotr Trojanek * sem_util.adb (Enclosing_Package_Or_Subprogram): Do not expect diff --git a/gcc/ada/libgnat/s-os_lib.adb b/gcc/ada/libgnat/s-os_lib.adb index 7efddf710c6..c3c1979ec9e 100644 --- a/gcc/ada/libgnat/s-os_lib.adb +++ b/gcc/ada/libgnat/s-os_lib.adb @@ -1629,10 +1629,12 @@ package body System.OS_Lib is pragma Import (C, C_Kill, "__gnat_kill"); begin - if Hard_Kill then - C_Kill (Pid, SIGKILL, 1); - else - C_Kill (Pid, SIGINT, 1); + if Pid /= Invalid_Pid then + if Hard_Kill then + C_Kill (Pid, SIGKILL, 1); + else + C_Kill (Pid, SIGINT, 1); + end if; end if; end Kill;