Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Pearce2016-08-19 23:10:58 +0000
committerGerrit Code Review @ Eclipse.org2016-08-19 23:11:03 +0000
commitb4192093f19e96407f031183c73746600838ef74 (patch)
treee432afbf313f5e56059288396ebf4057173162be
parentf15e9c088a6c50d96789fbeba04bb3272a5d3d4d (diff)
parent108bee17cfb13624030a405681701a412ed76676 (diff)
downloadjgit-b4192093f19e96407f031183c73746600838ef74.tar.gz
jgit-b4192093f19e96407f031183c73746600838ef74.tar.xz
jgit-b4192093f19e96407f031183c73746600838ef74.zip
Merge "Ignore IOException thrown from close"
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java11
1 files changed, 10 insertions, 1 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 253acbb76a..ec587d5997 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java
@@ -990,7 +990,16 @@ public abstract class FS {
new StreamGobbler(inRedirect, outputStream)
.call();
}
- outputStream.close();
+ try {
+ outputStream.close();
+ } catch (IOException e) {
+ // When the process exits before consuming the input, the OutputStream
+ // is replaced with the null output stream. This null output stream
+ // throws IOException for all write calls. When StreamGobbler fails to
+ // flush the buffer because of this, this close call tries to flush it
+ // again. This causes another IOException. Since we ignore the
+ // IOException in StreamGobbler, we also ignore the exception here.
+ }
return process.waitFor();
} catch (IOException e) {
ioException = e;

Back to the top