Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOtavio Pontes2012-06-19 13:57:40 -0400
committerOtavio Pontes2012-06-21 09:24:20 -0400
commiteded395b6290263fdd1afc669db4617c76a9d7a7 (patch)
treea8ce1486e7517133f9e88a26b1938f3ce3538c78 /valgrind
parent0f23fc93122eb3a061ef09129c7b7e6fd733422d (diff)
downloadorg.eclipse.linuxtools-eded395b6290263fdd1afc669db4617c76a9d7a7.tar.gz
org.eclipse.linuxtools-eded395b6290263fdd1afc669db4617c76a9d7a7.tar.xz
org.eclipse.linuxtools-eded395b6290263fdd1afc669db4617c76a9d7a7.zip
valgrind: Get inputStream before calling waitFor method
Diffstat (limited to 'valgrind')
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/internal/valgrind/core/ValgrindCommand.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/internal/valgrind/core/ValgrindCommand.java b/valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/internal/valgrind/core/ValgrindCommand.java
index 4e8c77cb16..c8012c2a6d 100644
--- a/valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/internal/valgrind/core/ValgrindCommand.java
+++ b/valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/internal/valgrind/core/ValgrindCommand.java
@@ -76,13 +76,16 @@ public class ValgrindCommand {
protected void readIntoBuffer(StringBuffer out, Process p) throws IOException {
boolean success;
- InputStream in;
+ InputStream in, err, input;
try {
+ //We need to get the inputs before calling waitFor
+ input = p.getInputStream();
+ err = p.getErrorStream();
if (success = (p.waitFor() == 0)) {
- in = p.getInputStream();
+ in = input;
}
else {
- in = p.getErrorStream();
+ in = err;
}
int ch;
while ((ch = in.read()) != -1) {

Back to the top