From 7b6cbde517a6bbd90f7abccef464f0a55d63ceef Mon Sep 17 00:00:00 2001 From: Thomas Corbat Date: Wed, 7 Oct 2015 15:22:44 +0200 Subject: [PATCH] Bug 479241 - [PTY] Output gets cut off after EOF on input Conflicts: core/org.eclipse.cdt.core.native/src/org/eclipse/cdt/utils/pty/PTYOutputStream.java Change-Id: If13b0d977f621e21e7fe89b2b52f07f74858787c Signed-off-by: Thomas Corbat --- .../org/eclipse/cdt/utils/pty/PTYOutputStream.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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