Commit fad242c9 authored by Christian Kandeler's avatar Christian Kandeler
Browse files

Maemo: Kill UTFS clients as well as UTFS servers in case of an error.

parent 97a56a62
......@@ -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
......@@ -108,6 +108,7 @@ private:
void startUtfsClients();
void killUtfsServer(QProcess *proc);
void killAllUtfsServers();
void killUtfsClients();
QString utfsClientOnDevice() const;
QString utfsServer() const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment