aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/tools
diff options
context:
space:
mode:
authorGravatar Laszlo Csomor <laszlocsomor@google.com>2018-07-09 04:32:32 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-07-09 04:33:56 -0700
commitc2b70f1e28b8fbc002efbac16d555f941c7d59a3 (patch)
tree79b2ab5eb0e1a7e4d971b94ba01e6415f7e6b5cd /src/tools
parent4304542a7438acaeb09559e71a971e56fbecc4e5 (diff)
Windows,JNI: more robust nativeCreateJunction
Rewrite the CreateJunction function in the Windows JNI library. The new implementation's improvements: - succeeds if the junction already exists with the desired target; hopefully this will fix issue https://github.com/bazelbuild/bazel/issues/5433 - tolerant to concurrent filesystem modifications, e.g. if the junction's path suddenly disappears, the function reports the error correctly Fixes https://github.com/bazelbuild/bazel/issues/5433 Change-Id: I58a2314a00f6edaa7c36c35ba54616168b44eb7d Closes #5528. Change-Id: I9f5dc9237b70a433d0d8c2578a826de3d462d110 PiperOrigin-RevId: 203744515
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/launcher/java_launcher.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/tools/launcher/java_launcher.cc b/src/tools/launcher/java_launcher.cc
index 82eeb0bcab..9e79627fa7 100644
--- a/src/tools/launcher/java_launcher.cc
+++ b/src/tools/launcher/java_launcher.cc
@@ -226,8 +226,9 @@ wstring JavaBinaryLauncher::CreateClasspathJar(const wstring& classpath) {
junction = junction_base_dir_norm + L"\\" +
std::to_wstring(junction_count++);
- wstring error(bazel::windows::CreateJunction(junction, jar_dir));
- if (!error.empty()) {
+ wstring error;
+ if (bazel::windows::CreateJunction(junction, jar_dir, &error) !=
+ bazel::windows::CreateJunctionResult::kSuccess) {
die(L"CreateClasspathJar failed: %s", error.c_str());
}