From 9bf3f6af2e42feb3ff7ef589b0d9570029bbab67 Mon Sep 17 00:00:00 2001 From: Dmitry Lomov Date: Thu, 7 Jul 2016 13:50:06 +0000 Subject: Rollback of commit 1e37a5375f918376c132fa537e25695f673f41b8. *** 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 --- scripts/bootstrap/compile.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'scripts') 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 $? -- cgit v1.2.3