[Ada] Remove unused parameter from __gnat_kill

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.
This commit is contained in:
Dmitriy Anisimkov 2021-12-21 13:49:40 +06:00 committed by Pierre-Marie de Rodat
parent 9a6f7575c1
commit 6b4c99cc92
3 changed files with 12 additions and 12 deletions

View 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.

View 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;

View 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;