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 <cliffred@cliffred.nl>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
This commit is contained in:
Cliffred van Velzen 2018-09-10 08:45:01 +02:00 committed by Matthias Sohn
parent 7b365b2faa
commit 0c8200b27b
1 changed files with 6 additions and 3 deletions

View File

@ -640,12 +640,15 @@ private boolean waitForProcessCompletion(IOException originalError) {
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) {