aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2012-07-20 18:29:34 +0000
committerDaniel Dunbar <daniel@zuster.org>2012-07-20 18:29:34 +0000
commitb1a464279623768a3d04ff6726c99dce35d2f360 (patch)
tree58a1ca607aae841dd5c880e4bbd4f458e5212cce /utils
parentdd2fb6c10b30e70ab8f910e21e583be3e90bb88c (diff)
downloadexternal_llvm-b1a464279623768a3d04ff6726c99dce35d2f360.zip
external_llvm-b1a464279623768a3d04ff6726c99dce35d2f360.tar.gz
external_llvm-b1a464279623768a3d04ff6726c99dce35d2f360.tar.bz2
lit: Use close_fds=True on UNIX, to avoid file descriptor pollution of
subprocesses. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160556 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/lit/lit/TestRunner.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/utils/lit/lit/TestRunner.py b/utils/lit/lit/TestRunner.py
index 3004d2c..71882b7 100644
--- a/utils/lit/lit/TestRunner.py
+++ b/utils/lit/lit/TestRunner.py
@@ -24,11 +24,15 @@ kUseCloseFDs = not kIsWindows
kAvoidDevNull = kIsWindows
def executeCommand(command, cwd=None, env=None):
+ # Close extra file handles on UNIX (on Windows this cannot be done while
+ # also redirecting input).
+ close_fds = not kIsWindows
+
p = subprocess.Popen(command, cwd=cwd,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
- env=env)
+ env=env, close_fds=close_fds)
out,err = p.communicate()
exitCode = p.wait()