aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/cpp/blaze.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/cpp/blaze.cc')
-rw-r--r--src/main/cpp/blaze.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/cpp/blaze.cc b/src/main/cpp/blaze.cc
index 0c4fa76a79..336dbc2d8e 100644
--- a/src/main/cpp/blaze.cc
+++ b/src/main/cpp/blaze.cc
@@ -1009,6 +1009,8 @@ static void EnsureCorrectRunningVersion() {
// installation is running.
string installation_path = globals->options.output_base + "/install";
char prev_installation[PATH_MAX + 1] = ""; // NULs the whole array
+ // TODO(dslomov): On Windows, readlink always fails,
+ // so we do the linking every time.
if (readlink(installation_path.c_str(),
prev_installation, PATH_MAX) == -1 ||
prev_installation != globals->options.install_base) {
@@ -1016,8 +1018,8 @@ static void EnsureCorrectRunningVersion() {
globals->restart_reason = NEW_VERSION;
}
unlink(installation_path.c_str());
- if (symlink(globals->options.install_base.c_str(),
- installation_path.c_str())) {
+ if (!SymlinkDirectories(globals->options.install_base.c_str(),
+ installation_path.c_str())) {
pdie(blaze_exit_code::LOCAL_ENVIRONMENTAL_ERROR,
"failed to create installation symlink '%s'",
installation_path.c_str());