aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/g-expect.adb
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2015-12-09 11:07:08 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2015-12-09 11:07:08 +0000
commitd4a0078bf84c49214033b8e8d8358dbf91101bbe (patch)
treeb77bc55ca4b0d55c396682d0ba55c2938bc39c20 /gcc/ada/g-expect.adb
parent76680678a8e6e41ed64b816c65298d3366ad7345 (diff)
downloadgcc-d4a0078bf84c49214033b8e8d8358dbf91101bbe.zip
gcc-d4a0078bf84c49214033b8e8d8358dbf91101bbe.tar.gz
gcc-d4a0078bf84c49214033b8e8d8358dbf91101bbe.tar.bz2
re PR ada/66526 (apparent use of uninitialized variables in g-expect.adb)
PR ada/66526 * g-expect.adb (Set_Up_Child_Communications): Add matching condition for uses of Input, Ouput and Error variables after the Execvp call. From-SVN: r231450
Diffstat (limited to 'gcc/ada/g-expect.adb')
-rw-r--r--gcc/ada/g-expect.adb23
1 files changed, 14 insertions, 9 deletions
diff --git a/gcc/ada/g-expect.adb b/gcc/ada/g-expect.adb
index 831d823..d7e65fb 100644
--- a/gcc/ada/g-expect.adb
+++ b/gcc/ada/g-expect.adb
@@ -1348,17 +1348,22 @@ 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 lines are only required for Windows systems and will
+ -- not be executed on Unix systems, but we use the same condition as
+ -- above to avoid warnings on uninitialized variables on Unix systems.
+ -- We are now in the parent process.
- -- Restore the old descriptors
+ if No_Fork_On_Target then
+
+ -- Restore the old descriptors
- Dup2 (Input, GNAT.OS_Lib.Standin);
- Dup2 (Output, GNAT.OS_Lib.Standout);
- Dup2 (Error, GNAT.OS_Lib.Standerr);
- Close (Input);
- Close (Output);
- Close (Error);
+ Dup2 (Input, GNAT.OS_Lib.Standin);
+ Dup2 (Output, GNAT.OS_Lib.Standout);
+ Dup2 (Error, GNAT.OS_Lib.Standerr);
+ Close (Input);
+ Close (Output);
+ Close (Error);
+ end if;
end Set_Up_Child_Communications;
---------------------------