From 0c8200b27b60baafd81bbaeeec0eb671891308e5 Mon Sep 17 00:00:00 2001 From: Cliffred van Velzen Date: Mon, 10 Sep 2018 08:45:01 +0200 Subject: [PATCH] Fix logging null if called process fails If some process executed by FS#readPipe ends in an error, the error stream is never set as errorMessage because FS#GobblerThread#waitForProcessCompletion always returned true. This caused LOG#warn to be called with null. Return false whenever FS#GobblerThread#waitForProcessCompletion fails. Bug: 538723 Change-Id: Ic9492bd688431d52c8665f7a2efec2989e95a4ce Signed-off-by: Cliffred van Velzen Signed-off-by: Matthias Sohn --- org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java index 6d3be7c686..ea3cf5f518 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java @@ -640,12 +640,15 @@ public abstract class FS { JGitText.get().commandClosedStderrButDidntExit, desc, PROCESS_EXIT_TIMEOUT), -1); fail.set(true); + return false; } } catch (InterruptedException e) { - LOG.error(MessageFormat.format( - JGitText.get().threadInterruptedWhileRunning, desc), e); + setError(originalError, MessageFormat.format( + JGitText.get().threadInterruptedWhileRunning, desc), -1); + fail.set(true); + return false; } - return false; + return true; } private void setError(IOException e, String message, int exitCode) { -- 2.39.5