forked from qt-creator/qt-creator
Maemo: Kill UTFS clients as well as UTFS servers in case of an error.
This commit is contained in:
@@ -308,7 +308,6 @@ void MaemoRemoteMounter::handleUtfsClientsFinished(int exitStatus)
|
||||
setState(Inactive);
|
||||
if (exitStatus == SshRemoteProcess::ExitedNormally
|
||||
&& m_mountProcess->exitCode() == 0) {
|
||||
m_utfsServerTimer->stop();
|
||||
emit reportProgress(tr("Mount operation succeeded."));
|
||||
emit mounted();
|
||||
} else {
|
||||
@@ -377,6 +376,7 @@ void MaemoRemoteMounter::handleUtfsServerError(QProcess::ProcessError)
|
||||
.arg(QString::fromLocal8Bit(errorOutput));
|
||||
}
|
||||
killAllUtfsServers();
|
||||
killUtfsClients();
|
||||
emit error(tr("Error running UTFS server: %1").arg(errorString));
|
||||
|
||||
setState(Inactive);
|
||||
@@ -434,8 +434,8 @@ void MaemoRemoteMounter::handleUtfsServerTimeout()
|
||||
return;
|
||||
|
||||
killAllUtfsServers();
|
||||
killUtfsClients();
|
||||
emit error(tr("Timeout waiting for UTFS servers to connect."));
|
||||
// TODO: utfs clients are still waiting; kill them here
|
||||
|
||||
setState(Inactive);
|
||||
}
|
||||
@@ -459,5 +459,13 @@ void MaemoRemoteMounter::setState(State newState)
|
||||
m_state = newState;
|
||||
}
|
||||
|
||||
void MaemoRemoteMounter::killUtfsClients()
|
||||
{
|
||||
const SshRemoteProcess::Ptr utfsClientKiller
|
||||
= m_connection->createRemoteProcess("pkill utfs-client; sleep 1; "
|
||||
"pkill -9 utfs-client");
|
||||
utfsClientKiller->start();
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Qt4ProjectManager
|
||||
|
||||
Reference in New Issue
Block a user