aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tools/launcher/java_launcher.cc14
-rw-r--r--src/tools/launcher/launcher.cc9
-rw-r--r--src/tools/launcher/launcher.h3
3 files changed, 12 insertions, 14 deletions
diff --git a/src/tools/launcher/java_launcher.cc b/src/tools/launcher/java_launcher.cc
index 15a3354fb3..af60de2fed 100644
--- a/src/tools/launcher/java_launcher.cc
+++ b/src/tools/launcher/java_launcher.cc
@@ -185,20 +185,14 @@ string JavaBinaryLauncher::CreateClasspathJar(const string& classpath) {
jar_manifest_file.close();
// Create the command for generating classpath jar.
- // We pass the command to cmd.exe to use redirection for suppressing output.
string manifest_jar_path = binary_base_path + rand_id + "-classpath.jar";
string jar_bin = this->Rlocation(this->GetLaunchInfoByKey(JAR_BIN_PATH));
vector<string> arguments;
- arguments.push_back("/c");
+ arguments.push_back("cvfm");
+ arguments.push_back(manifest_jar_path);
+ arguments.push_back(jar_manifest_file_path);
- ostringstream jar_command;
- jar_command << jar_bin << " cvfm ";
- jar_command << manifest_jar_path << " ";
- jar_command << jar_manifest_file_path << " ";
- jar_command << "> nul";
- arguments.push_back(jar_command.str());
-
- if (this->LaunchProcess("cmd.exe", arguments) != 0) {
+ if (this->LaunchProcess(jar_bin, arguments, /* suppressOutput */ true) != 0) {
die("Couldn't create classpath jar: %s", manifest_jar_path.c_str());
}
diff --git a/src/tools/launcher/launcher.cc b/src/tools/launcher/launcher.cc
index a657fa41e7..d26506e1b1 100644
--- a/src/tools/launcher/launcher.cc
+++ b/src/tools/launcher/launcher.cc
@@ -176,8 +176,9 @@ bool BinaryLauncherBase::PrintLauncherCommandLine(
return has_print_cmd_flag;
}
-ExitCode BinaryLauncherBase::LaunchProcess(
- const string& executable, const vector<string>& arguments) const {
+ExitCode BinaryLauncherBase::LaunchProcess(const string& executable,
+ const vector<string>& arguments,
+ bool suppressOutput) const {
if (PrintLauncherCommandLine(executable, arguments)) {
return 0;
}
@@ -194,7 +195,9 @@ ExitCode BinaryLauncherBase::LaunchProcess(
/* lpProcessAttributes */ NULL,
/* lpThreadAttributes */ NULL,
/* bInheritHandles */ FALSE,
- /* dwCreationFlags */ 0,
+ /* dwCreationFlags */
+ suppressOutput ? CREATE_NO_WINDOW // no console window => no output
+ : 0,
/* lpEnvironment */ NULL,
/* lpCurrentDirectory */ NULL,
/* lpStartupInfo */ &startupInfo,
diff --git a/src/tools/launcher/launcher.h b/src/tools/launcher/launcher.h
index 905e7c169a..088bd5d740 100644
--- a/src/tools/launcher/launcher.h
+++ b/src/tools/launcher/launcher.h
@@ -66,7 +66,8 @@ class BinaryLauncherBase {
// it doesn't include the exectuable itself.
// The arguments are expected to be quoted if having spaces.
ExitCode LaunchProcess(const std::string& executable,
- const std::vector<std::string>& arguments) const;
+ const std::vector<std::string>& arguments,
+ bool suppressOutput = false) const;
// A launch function to be implemented for a specific language.
virtual ExitCode Launch() = 0;