Commit ac072e4c authored by hjk's avatar hjk
Browse files

devicesupport: use /proc/exe to retrieve a full path

Change-Id: I8bb91b72a5a2a3547eced9a99cceebd9952bc21a
Reviewed-by: default avatarChristian Kandeler <>
parent e3c6506e
......@@ -176,11 +176,16 @@ static QList<DeviceProcess> getLocalProcessesUsingProc(const QDir &procDir)
DeviceProcess proc; = procId.toInt();
const QString root = procDirPath + procId;
QFile exeFile(root + QLatin1String("/exe"));
proc.exe = exeFile.symLinkTarget();
QFile cmdLineFile(root + QLatin1String("/cmdline"));
if ( { // process may have exited
QList<QByteArray> tokens = cmdLineFile.readAll().split('\0');
if (!tokens.isEmpty()) {
proc.exe = QString::fromLocal8Bit(tokens.front());
if (proc.exe.isEmpty())
proc.exe = QString::fromLocal8Bit(tokens.front());
foreach (const QByteArray &t, tokens) {
if (!proc.cmdLine.isEmpty())
proc.cmdLine.append(QLatin1Char(' '));
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