Index: build/android/pylib/cmd_helper.py |
diff --git a/build/android/pylib/cmd_helper.py b/build/android/pylib/cmd_helper.py |
index bce3f97e6598268418341fb8cb128d14b5c6ac6a..dba399f8193f333ebcc94a880cb540ba83d90976 100644 |
--- a/build/android/pylib/cmd_helper.py |
+++ b/build/android/pylib/cmd_helper.py |
@@ -14,13 +14,20 @@ import tempfile |
import constants |
-def Call(args, stdout=None, stderr=None, shell=None, cwd=None, env=None): |
- return subprocess.call( |
+def Popen(args, stdout=None, stderr=None, shell=None, cwd=None, env=None): |
+ return subprocess.Popen( |
args=args, cwd=cwd, stdout=stdout, stderr=stderr, |
shell=shell, close_fds=True, env=env, |
preexec_fn=lambda: signal.signal(signal.SIGPIPE, signal.SIG_DFL)) |
+def Call(args, stdout=None, stderr=None, shell=None, cwd=None, env=None): |
+ pipe = Popen(args, stdout=stdout, stderr=stderr, shell=shell, cwd=cwd, |
+ env=env) |
+ pipe.communicate() |
+ return pipe.wait() |
+ |
+ |
def RunCmd(args, cwd=None): |
"""Opens a subprocess to execute a program and returns its return value. |