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 6bdfa8a68a2..0e6bf3cf0d8 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 @@ -72,14 +72,15 @@ public class PTYOutputStream extends OutputStream { public void close() throws IOException { if (master.getFD() == -1) return; - // For non-windows platforms, send EOT before closing - if (!Platform.OS_WIN32.equals(Platform.getOS())) { + // 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