1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 09:25:31 +02:00

close the outputstream of Process

This commit is contained in:
Alain Magloire 2002-12-13 15:43:40 +00:00
parent 72e5cc60b6
commit 493342d6b2

View file

@ -5,6 +5,7 @@ package org.eclipse.cdt.internal.core;
* All Rights Reserved.
*/
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Arrays;
@ -145,7 +146,13 @@ public class CBuilder extends ACBuilder {
OutputStream stdout = epm.getOutputStream();
OutputStream stderr = epm.getOutputStream();
launcher.execute(makepath, userArgs, env, workingDirectory);
Process p = launcher.execute(makepath, userArgs, env, workingDirectory);
try {
// Close the input of the Process explicitely.
// We will never write to it.
p.getOutputStream().close();
} catch (IOException e) {
}
if (launcher.waitAndRead(stdout, stderr, subMonitor) != CommandLauncher.OK)
errMsg = launcher.getErrorMessage();