aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/bootstrap/compile.sh
diff options
context:
space:
mode:
authorGravatar Dmitry Lomov <dslomov@google.com>2016-07-07 13:50:06 +0000
committerGravatar Yun Peng <pcloudy@google.com>2016-07-07 14:54:16 +0000
commit9bf3f6af2e42feb3ff7ef589b0d9570029bbab67 (patch)
treee9df963f80c4c497666c9e81cf958316c28e5bb1 /scripts/bootstrap/compile.sh
parent345e15e9f84c4ab21d26a51d8ed6e62f89210e78 (diff)
*** Reason for rollback *** Apparently we now try to open output files for the process twice: once when we are constructing the output streams, and the second time when we tell the process to redirect its outputs. This causes the outputs to be empty on Windows *** Original change description *** Do redirection of stdout / stderr in Java instead of reimplementing it in every process wrapper again. -- MOS_MIGRATED_REVID=126801016
Diffstat (limited to 'scripts/bootstrap/compile.sh')
-rwxr-xr-xscripts/bootstrap/compile.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/scripts/bootstrap/compile.sh b/scripts/bootstrap/compile.sh
index 09bb32cff1..2cb8e58710 100755
--- a/scripts/bootstrap/compile.sh
+++ b/scripts/bootstrap/compile.sh
@@ -227,6 +227,31 @@ cat <<'EOF' >${ARCHIVE_DIR}/_embedded_binaries/process-wrapper${EXE_EXT}
#!/bin/sh
# Dummy process wrapper, does not support timeout
shift 2
+stdout="$1"
+stderr="$2"
+shift 2
+
+if [ "$stdout" = "-" ]
+then
+ if [ "$stderr" = "-" ]
+ then
+ "$@"
+ exit $?
+ else
+ "$@" 2>"$stderr"
+ exit $?
+ fi
+else
+ if [ "$stderr" = "-" ]
+ then
+ "$@" >"$stdout"
+ exit $?
+ else
+ "$@" 2>"$stderr" >"$stdout"
+ exit $?
+ fi
+fi
+
"$@"
exit $?