diff --git a/core/org.eclipse.cdt.core.native/src/org/eclipse/cdt/utils/pty/PTYOutputStream.java b/core/org.eclipse.cdt.core.native/src/org/eclipse/cdt/utils/pty/PTYOutputStream.java index f5335c18375..c30f08de802 100644 --- a/core/org.eclipse.cdt.core.native/src/org/eclipse/cdt/utils/pty/PTYOutputStream.java +++ b/core/org.eclipse.cdt.core.native/src/org/eclipse/cdt/utils/pty/PTYOutputStream.java @@ -15,6 +15,7 @@ import java.io.IOException; import java.io.OutputStream; import org.eclipse.cdt.utils.pty.PTY.MasterFD; +import org.eclipse.core.runtime.Platform; public class PTYOutputStream extends OutputStream { @@ -84,13 +85,15 @@ public class PTYOutputStream extends OutputStream { public void close() throws IOException { if (master.getFD() == -1) return; - if (sendEotBeforeClose) { + // For non-windows platforms, send EOT instead of closing + if (Platform.OS_WIN32.equals(Platform.getOS())) { + int status = close0(master.getFD()); + if (status == -1) + throw new IOException("close error"); //$NON-NLS-1$ + master.setFD(-1); + } else { write(EOT); } - int status = close0(master.getFD()); - if (status == -1) - throw new IOException("close error"); //$NON-NLS-1$ - master.setFD(-1); } @Override