1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-06 08:35:26 +02:00

Bug 479241 - [PTY] Output gets cut off after EOF on input

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
parent 9071fbcc8c
commit 5d7ae91e41

View file

@ -72,14 +72,15 @@ public class PTYOutputStream extends OutputStream {
public void close() throws IOException { public void close() throws IOException {
if (master.getFD() == -1) if (master.getFD() == -1)
return; return;
// For non-windows platforms, send EOT before closing // For non-windows platforms, send EOT instead of closing
if (!Platform.OS_WIN32.equals(Platform.getOS())) { 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); write(EOT);
} }
int status = close0(master.getFD());
if (status == -1)
throw new IOException("close error"); //$NON-NLS-1$
master.setFD(-1);
} }
@Override @Override