mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-01 22:25:25 +02:00
[274153] Applied Yu-Fen's patch.
This commit is contained in:
parent
f85de17305
commit
2fe6818ed1
2 changed files with 10 additions and 10 deletions
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2008 Wind River Systems, Inc. and others.
|
||||
* Copyright (c) 2008, 2011 Wind River Systems, Inc. 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
|
||||
|
@ -9,6 +9,7 @@
|
|||
* Martin Oberhuber (Wind River) - initial API and implementation
|
||||
* Anna Dushistova (MontaVista) - [170910] Integrate the TM Terminal View with RSE
|
||||
* Martin Oberhuber (Wind River) - [227320] Fix endless loop in SshTerminalShell
|
||||
* Yufen Kuo (MontaVista) - [274153] Fix pipe closed with RSE
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.rse.internal.services.ssh.terminal;
|
||||
|
@ -208,7 +209,10 @@ public class SshTerminalShell extends AbstractTerminalShell {
|
|||
fChannel.disconnect();
|
||||
} finally {
|
||||
fChannel = null;
|
||||
isActive();
|
||||
}
|
||||
Session session = fSessionProvider.getSession();
|
||||
if (session != null && !session.isConnected()) {
|
||||
fSessionProvider.handleSessionLost();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -217,12 +221,6 @@ public class SshTerminalShell extends AbstractTerminalShell {
|
|||
if (fChannel != null && !fChannel.isEOF()) {
|
||||
return true;
|
||||
}
|
||||
// shell is not active: check for session lost
|
||||
exit();
|
||||
Session session = fSessionProvider.getSession();
|
||||
if (session != null && !session.isConnected()) {
|
||||
fSessionProvider.handleSessionLost();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2006, 2008 PalmSource, Inc. and others.
|
||||
* Copyright (c) 2006, 2011, PalmSource, Inc. 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
|
||||
|
@ -12,6 +12,7 @@
|
|||
* Martin Oberhuber (Wind River) - renamed from HostShellAdapter (bug 161777)
|
||||
* Martin Oberhuber (Wind River) - improved Javadoc
|
||||
* Greg Watson (IBM) - patch for bug #252060
|
||||
* Yufen Kuo (MontaVista) - [274153] Fix pipe closed with RSE
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.rse.services.shells;
|
||||
|
@ -84,6 +85,7 @@ IHostShellOutputListener {
|
|||
public synchronized int exitValue() {
|
||||
if(hostShell.isActive())
|
||||
throw new IllegalThreadStateException();
|
||||
hostShell.exit();
|
||||
// No way to tell what the exit value was.
|
||||
// TODO it would be possible to get the exit value
|
||||
// when the remote process is started like this:
|
||||
|
@ -136,7 +138,7 @@ IHostShellOutputListener {
|
|||
// Allow for the data from the stream to be read if it's available
|
||||
if (inputStream.available() != 0 || errorStream.available() != 0)
|
||||
throw new InterruptedException();
|
||||
|
||||
hostShell.exit();
|
||||
hostShellInput.close();
|
||||
hostShellError.close();
|
||||
inputStream.close();
|
||||
|
|
Loading…
Add table
Reference in a new issue