diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-07-28 07:29:50 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-07-28 07:29:50 +0000 |
commit | 579986833c399388f95a7f20e9031ea96e96a02d (patch) | |
tree | a38f52a14940fd6eb259c9bfcc8d99a88aaf4e4e /gcc/ada/g-expect.adb | |
parent | 56aa98d4ed0d549ee548a61e93b732459c87c20a (diff) | |
download | gcc-579986833c399388f95a7f20e9031ea96e96a02d.tar.gz |
2009-07-28 Sergey Rybin <rybin@adacore.com>
* gnat_ugn.texi: gnatcheck Deeply_Nested_Inlining rule: Update doc.
2009-07-28 Pascal Obry <obry@adacore.com>
* g-expect.adb: Record standard handles only on Windows.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150145 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/g-expect.adb')
-rw-r--r-- | gcc/ada/g-expect.adb | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/gcc/ada/g-expect.adb b/gcc/ada/g-expect.adb index 405b0331275..5f88f63f076 100644 --- a/gcc/ada/g-expect.adb +++ b/gcc/ada/g-expect.adb @@ -1195,21 +1195,25 @@ package body GNAT.Expect is pragma Warnings (Off, Pipe2); pragma Warnings (Off, Pipe3); + On_Windows : constant Boolean := Directory_Separator = '\'; + Input : File_Descriptor; Output : File_Descriptor; Error : File_Descriptor; begin - -- Since Windows does not have a separate fork/exec, we need to - -- perform the following actions: - -- - save stdin, stdout, stderr - -- - replace them by our pipes - -- - create the child with process handle inheritance - -- - revert to the previous stdin, stdout and stderr. - - Input := Dup (GNAT.OS_Lib.Standin); - Output := Dup (GNAT.OS_Lib.Standout); - Error := Dup (GNAT.OS_Lib.Standerr); + if On_Windows then + -- Since Windows does not have a separate fork/exec, we need to + -- perform the following actions: + -- - save stdin, stdout, stderr + -- - replace them by our pipes + -- - create the child with process handle inheritance + -- - revert to the previous stdin, stdout and stderr. + + Input := Dup (GNAT.OS_Lib.Standin); + Output := Dup (GNAT.OS_Lib.Standout); + Error := Dup (GNAT.OS_Lib.Standerr); + end if; -- Since we are still called from the parent process, there is no way -- currently we can cleanly close the unneeded ends of the pipes, but @@ -1223,8 +1227,8 @@ package body GNAT.Expect is Portable_Execvp (Pid.Pid'Access, Cmd & ASCII.NUL, Args); - -- The following commands are not executed on Unix systems, and are - -- only required for Windows systems. We are now in the parent process. + -- The following commands are not executed on Unix systems, and are only + -- required for Windows systems. We are now in the parent process. -- Restore the old descriptors @@ -1277,8 +1281,8 @@ package body GNAT.Expect is -- Reuse the standard output pipe for standard error Pipe3.all := Pipe2.all; - else + else -- Create a separate pipe for standard error if Create_Pipe (Pipe3) /= 0 then |