aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google
diff options
context:
space:
mode:
authorGravatar Laszlo Csomor <laszlocsomor@google.com>2018-07-24 02:05:53 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-07-24 02:07:03 -0700
commit2b4a22c752e112181fa0841407a7a95966ff847f (patch)
tree4a41fb96cc300ea1efcbc4b3d18f43f3e0f938b5 /src/main/java/com/google
parent543918dcfd1744422273962eede43dede297e0f5 (diff)
Windows,JNI: more tolerance for errors
DeletePath and CreateJunction are now even more tolerant with errors, particularly the class of errors where access is denied. Also in this change: - remove DeletePathResult::kParentMissing, as this case is handled by CreateFileW's error handling later - do not error-check CreateDirectoryW; if failed, just proceed as if the directory already existed - print more debugging info where possible Change-Id: I1162dae2c6b7524f14d8892047f9eb51831470dd Closes #5611. Change-Id: I78fe6aed6d0b120815339c0923c8a903990921d9 PiperOrigin-RevId: 205796307
Diffstat (limited to 'src/main/java/com/google')
-rw-r--r--src/main/java/com/google/devtools/build/lib/windows/jni/WindowsFileOperations.java12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/windows/jni/WindowsFileOperations.java b/src/main/java/com/google/devtools/build/lib/windows/jni/WindowsFileOperations.java
index 4b5d74f701..8401d743f6 100644
--- a/src/main/java/com/google/devtools/build/lib/windows/jni/WindowsFileOperations.java
+++ b/src/main/java/com/google/devtools/build/lib/windows/jni/WindowsFileOperations.java
@@ -53,11 +53,10 @@ public class WindowsFileOperations {
private static final int CREATE_JUNCTION_SUCCESS = 0;
private static final int CREATE_JUNCTION_ERROR = 1;
private static final int CREATE_JUNCTION_TARGET_NAME_TOO_LONG = 2;
- private static final int CREATE_JUNCTION_PARENT_MISSING = 3;
- private static final int CREATE_JUNCTION_ALREADY_EXISTS_WITH_DIFFERENT_TARGET = 4;
- private static final int CREATE_JUNCTION_ALREADY_EXISTS_BUT_NOT_A_JUNCTION = 5;
- private static final int CREATE_JUNCTION_ACCESS_DENIED = 6;
- private static final int CREATE_JUNCTION_DISAPPEARED = 7;
+ private static final int CREATE_JUNCTION_ALREADY_EXISTS_WITH_DIFFERENT_TARGET = 3;
+ private static final int CREATE_JUNCTION_ALREADY_EXISTS_BUT_NOT_A_JUNCTION = 4;
+ private static final int CREATE_JUNCTION_ACCESS_DENIED = 5;
+ private static final int CREATE_JUNCTION_DISAPPEARED = 6;
// Keep DELETE_PATH_* values in sync with src/main/native/windows/file.cc.
private static final int DELETE_PATH_SUCCESS = 0;
@@ -141,9 +140,6 @@ public class WindowsFileOperations {
case CREATE_JUNCTION_TARGET_NAME_TOO_LONG:
error[0] = "target name is too long";
break;
- case CREATE_JUNCTION_PARENT_MISSING:
- error[0] = "a parent directory is missing";
- break;
case CREATE_JUNCTION_ALREADY_EXISTS_WITH_DIFFERENT_TARGET:
error[0] = "junction already exists with different target";
break;