summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/ProcessUNIX.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2005-04-21 20:05:09 (GMT)
committerBrad King <brad.king@kitware.com>2005-04-21 20:05:09 (GMT)
commit8567e7d0bc0595824cfd99ecc1e31b23ad189e8a (patch)
tree69323777aa38bd7405010bd888b816d59ac64e20 /Source/kwsys/ProcessUNIX.c
parent3f224b755805cac375fecb13da08c17b188fae01 (diff)
downloadCMake-8567e7d0bc0595824cfd99ecc1e31b23ad189e8a.zip
CMake-8567e7d0bc0595824cfd99ecc1e31b23ad189e8a.tar.gz
CMake-8567e7d0bc0595824cfd99ecc1e31b23ad189e8a.tar.bz2
BUG: Do not close stdout/stderr pipes in parent if they are shared.
Diffstat (limited to 'Source/kwsys/ProcessUNIX.c')
-rw-r--r--Source/kwsys/ProcessUNIX.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/kwsys/ProcessUNIX.c b/Source/kwsys/ProcessUNIX.c
index 31e34ed..262d2df 100644
--- a/Source/kwsys/ProcessUNIX.c
+++ b/Source/kwsys/ProcessUNIX.c
@@ -689,7 +689,10 @@ void kwsysProcess_Execute(kwsysProcess* cp)
}
/* The parent process does not need the output pipe write ends. */
- kwsysProcessCleanupDescriptor(&si.StdErr);
+ if(si.StdErr != 2)
+ {
+ kwsysProcessCleanupDescriptor(&si.StdErr);
+ }
kwsysProcessCleanupDescriptor(&si.TermPipe);
/* Restore the working directory. */
@@ -1395,7 +1398,10 @@ static int kwsysProcessCreate(kwsysProcess* cp, int prIndex,
}
/* The parent process does not need the output pipe write ends. */
- kwsysProcessCleanupDescriptor(&si->StdOut);
+ if(si->StdOut != 1)
+ {
+ kwsysProcessCleanupDescriptor(&si->StdOut);
+ }
return 1;
}