]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Remove unused parameter from __gnat_kill
authorDmitriy Anisimkov <anisimko@adacore.com>
Tue, 21 Dec 2021 07:49:40 +0000 (13:49 +0600)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 9 May 2022 09:27:28 +0000 (09:27 +0000)
Remove close parameter from __gnat_kill because it is not used in
implementation.

gcc/ada/

* adaint.c (__gnat_kill): Remove close parameter.
(__gnat_killprocesstree): Do not provide close parameter on call
to __gnat_kill.
* libgnat/g-expect.adb (Kill): Remove Close parameter.
(Close): Do not provide Close parameter on call to Kill.
(Send_Signal): Do not provide Close parameter on call to Kill.
* libgnat/s-os_lib.adb (Kill): Do not provide close parameter on
call to __gnat_kill.

gcc/ada/adaint.c
gcc/ada/libgnat/g-expect.adb
gcc/ada/libgnat/s-os_lib.adb

index 591d033fbca17373a02af768ea805b205ab21caf..2ae4dedeb2b73dd7f2d4cb464f2ea2113f4006c5 100644 (file)
@@ -3556,7 +3556,7 @@ __gnat_get_executable_load_address (void)
 }
 
 void
-__gnat_kill (int pid, int sig, int close ATTRIBUTE_UNUSED)
+__gnat_kill (int pid, int sig)
 {
 #if defined(_WIN32)
   HANDLE h;
@@ -3595,7 +3595,7 @@ void __gnat_killprocesstree (int pid, int sig_num)
 
   if (hSnap == INVALID_HANDLE_VALUE)
     {
-      __gnat_kill (pid, sig_num, 1);
+      __gnat_kill (pid, sig_num);
       return;
     }
 
@@ -3618,7 +3618,7 @@ void __gnat_killprocesstree (int pid, int sig_num)
 
   /* kill process */
 
-  __gnat_kill (pid, sig_num, 1);
+  __gnat_kill (pid, sig_num);
 
 #elif defined (__vxworks)
   /* not implemented */
@@ -3635,7 +3635,7 @@ void __gnat_killprocesstree (int pid, int sig_num)
 
   if (!dir)
     {
-      __gnat_kill (pid, sig_num, 1);
+      __gnat_kill (pid, sig_num);
       return;
     }
 
@@ -3673,9 +3673,9 @@ void __gnat_killprocesstree (int pid, int sig_num)
 
   /* kill process */
 
-  __gnat_kill (pid, sig_num, 1);
+  __gnat_kill (pid, sig_num);
 #else
-  __gnat_kill (pid, sig_num, 1);
+  __gnat_kill (pid, sig_num);
 #endif
   /* Note on Solaris it is possible to read /proc/<PID>/status.
      The 5th and 6th words are the pid and the 7th and 8th the ppid.
index 1c5b8312d7c5363e2b1f0638819a2cc2cd7e4a4a..56554c01bcd4a7b607e85fb22ad2f7ab94e27308 100644 (file)
@@ -96,7 +96,7 @@ package body GNAT.Expect is
    procedure Dup2 (Old_Fd, New_Fd : File_Descriptor);
    pragma Import (C, Dup2);
 
-   procedure Kill (Pid : Process_Id; Sig_Num : Integer; Close : Integer);
+   procedure Kill (Pid : Process_Id; Sig_Num : Integer);
    pragma Import (C, Kill, "__gnat_kill");
    --  if Close is set to 1 all OS resources used by the Pid must be freed
 
@@ -223,7 +223,7 @@ package body GNAT.Expect is
 
    begin
       if Descriptor.Pid > 0 then  --  see comment in Send_Signal
-         Kill (Descriptor.Pid, Sig_Num => 9, Close => 0);
+         Kill (Descriptor.Pid, Sig_Num => 9);
       end if;
 
       Close_Input (Descriptor);
@@ -1347,7 +1347,7 @@ package body GNAT.Expect is
       --  started; we don't want to kill ourself in that case.
 
       if Descriptor.Pid > 0 then
-         Kill (Descriptor.Pid, Signal, Close => 1);
+         Kill (Descriptor.Pid, Signal);
          --  ??? Need to check process status here
       else
          raise Invalid_Process;
index 0681580b9b232ef3fb33fce4341105252f998ce2..5af65866b2b332f48371f845d1292a8125407ef9 100644 (file)
@@ -1602,15 +1602,15 @@ package body System.OS_Lib is
       SIGKILL : constant := 9;
       SIGINT  : constant := 2;
 
-      procedure C_Kill (Pid : Process_Id; Sig_Num : Integer; Close : Integer);
+      procedure C_Kill (Pid : Process_Id; Sig_Num : Integer);
       pragma Import (C, C_Kill, "__gnat_kill");
 
    begin
       if Pid /= Invalid_Pid then
          if Hard_Kill then
-            C_Kill (Pid, SIGKILL, 1);
+            C_Kill (Pid, SIGKILL);
          else
-            C_Kill (Pid, SIGINT, 1);
+            C_Kill (Pid, SIGINT);
          end if;
       end if;
    end Kill;