1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 01:15:29 +02:00

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 <tcorbat@hsr.ch>
This commit is contained in:
Thomas Corbat 2015-10-07 15:22:44 +02:00 committed by Thomas Corbat
parent 12931d59a7
commit 7b6cbde517

View file

@ -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