mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-02 22:05:44 +02:00
Bug 159803 - Console View Ignores EOF
Added statement to send end of transmission (ASCII 4) before close for non-Windows PTY. Change-Id: If98848a833f7619ce93277d05d39f3ba986a3cf4
This commit is contained in:
parent
c87e334bf5
commit
c5aacf2a6b
3 changed files with 10 additions and 3 deletions
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %pluginName
|
||||
Bundle-SymbolicName: org.eclipse.cdt.core.native;singleton:=true
|
||||
Bundle-Version: 5.8.0.qualifier
|
||||
Bundle-Version: 5.8.1.qualifier
|
||||
Bundle-Activator: org.eclipse.cdt.internal.core.natives.CNativePlugin
|
||||
Bundle-Vendor: %providerName
|
||||
Bundle-Localization: plugin
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<version>5.8.0-SNAPSHOT</version>
|
||||
<version>5.8.1-SNAPSHOT</version>
|
||||
<artifactId>org.eclipse.cdt.core.native</artifactId>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
</project>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2000, 2014 QNX Software Systems and others.
|
||||
* Copyright (c) 2000, 2015 QNX Software Systems and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -15,9 +15,12 @@ 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 {
|
||||
|
||||
private static final byte EOT = '\4';
|
||||
|
||||
MasterFD master;
|
||||
|
||||
/**
|
||||
|
@ -69,6 +72,10 @@ 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())) {
|
||||
write(EOT);
|
||||
}
|
||||
int status = close0(master.getFD());
|
||||
if (status == -1)
|
||||
throw new IOException("close error"); //$NON-NLS-1$
|
||||
|
|
Loading…
Add table
Reference in a new issue