Commit f17267c8 by Gary Dismukes Committed by Pierre-Marie de Rodat

[Ada] Typo fixes and minor reformatting

2019-12-16  Gary Dismukes  <dismukes@adacore.com>

gcc/ada/

	* libgnat/g-exptty.adb, libgnat/g-exptty.ads: Typo fixes and
	minor reformatting.

From-SVN: r279415
parent 6a6ac079
2019-12-16 Gary Dismukes <dismukes@adacore.com>
* libgnat/g-exptty.adb, libgnat/g-exptty.ads: Typo fixes and
minor reformatting.
2019-12-16 Eric Botcazou <ebotcazou@adacore.com> 2019-12-16 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch6.adb (Requires_Atomic_Or_Volatile_Copy): New predicate. * exp_ch6.adb (Requires_Atomic_Or_Volatile_Copy): New predicate.
......
...@@ -38,8 +38,9 @@ package body GNAT.Expect.TTY is ...@@ -38,8 +38,9 @@ package body GNAT.Expect.TTY is
On_Windows : constant Boolean := Directory_Separator = '\'; On_Windows : constant Boolean := Directory_Separator = '\';
-- True when on Windows -- True when on Windows
function Waitpid (Process : System.Address; Blocking : Integer) function Waitpid
return Integer; (Process : System.Address;
Blocking : Integer) return Integer;
pragma Import (C, Waitpid, "__gnat_tty_waitpid"); pragma Import (C, Waitpid, "__gnat_tty_waitpid");
-- Wait for a specific process id, and return its exit code -- Wait for a specific process id, and return its exit code
...@@ -48,8 +49,7 @@ package body GNAT.Expect.TTY is ...@@ -48,8 +49,7 @@ package body GNAT.Expect.TTY is
------------------------ ------------------------
function Is_Process_Running function Is_Process_Running
(Descriptor : in out TTY_Process_Descriptor) (Descriptor : in out TTY_Process_Descriptor) return Boolean
return Boolean
is is
begin begin
if Descriptor.Process = System.Null_Address then if Descriptor.Process = System.Null_Address then
...@@ -57,6 +57,7 @@ package body GNAT.Expect.TTY is ...@@ -57,6 +57,7 @@ package body GNAT.Expect.TTY is
end if; end if;
Descriptor.Exit_Status := Waitpid (Descriptor.Process, Blocking => 0); Descriptor.Exit_Status := Waitpid (Descriptor.Process, Blocking => 0);
return Descriptor.Exit_Status = Still_Active; return Descriptor.Exit_Status = Still_Active;
end Is_Process_Running; end Is_Process_Running;
...@@ -106,17 +107,20 @@ package body GNAT.Expect.TTY is ...@@ -106,17 +107,20 @@ package body GNAT.Expect.TTY is
Status := Waitpid (Descriptor.Process, Blocking => 0); Status := Waitpid (Descriptor.Process, Blocking => 0);
if Status = Still_Active then if Status = Still_Active then
-- In theory the process might hav died since the check. In -- In theory the process might have died since the check. In
-- practice the following calls should not cause any issue. -- practice the following calls should not cause any issue.
Interrupt (Descriptor); Interrupt (Descriptor);
delay (0.05); delay (0.05);
Terminate_Process (Descriptor.Process); Terminate_Process (Descriptor.Process);
Status := Waitpid (Descriptor.Process, Blocking => 1); Status := Waitpid (Descriptor.Process, Blocking => 1);
Descriptor.Exit_Status := Status; Descriptor.Exit_Status := Status;
end if; end if;
else else
-- If Exit_Status is not STILL_ACTIVE just retrieve the saved -- If Exit_Status is not STILL_ACTIVE just retrieve the saved
-- exit status -- exit status.
Status := Descriptor.Exit_Status; Status := Descriptor.Exit_Status;
end if; end if;
......
...@@ -95,7 +95,7 @@ package GNAT.Expect.TTY is ...@@ -95,7 +95,7 @@ package GNAT.Expect.TTY is
function Is_Process_Running function Is_Process_Running
(Descriptor : in out TTY_Process_Descriptor) (Descriptor : in out TTY_Process_Descriptor)
return Boolean; return Boolean;
-- Return True is the process is still alive -- Returns True if the process is still alive
private private
...@@ -142,7 +142,7 @@ private ...@@ -142,7 +142,7 @@ private
Process : System.Address := System.Null_Address; Process : System.Address := System.Null_Address;
-- Underlying structure used in C -- Underlying structure used in C
Exit_Status : Integer := Still_Active; Exit_Status : Integer := Still_Active;
-- Hold the exit status of the process. -- Holds the exit status of the process
Use_Pipes : Boolean := True; Use_Pipes : Boolean := True;
end record; end record;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment