QLockFile/Unix: remove the " (deleted)" suffix from kernel-supplied names
The kernel appends that to the symlink targets in /proc for files that have been deleted. Change-Id: I7a386ad4f0cb4e2ba629fffd16789b5a52491627 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
This commit is contained in:
parent
615972b74f
commit
c58be606dd
@ -238,6 +238,12 @@ QString QLockFilePrivate::processNameByPid(qint64 pid)
|
||||
// The pid is gone. Return some invalid process name to fail the test.
|
||||
return QStringLiteral("/ERROR/");
|
||||
}
|
||||
|
||||
// remove the " (deleted)" suffix, if any
|
||||
static const char deleted[] = " (deleted)";
|
||||
if (buf.endsWith(deleted))
|
||||
buf.chop(strlen(deleted));
|
||||
|
||||
return QFileInfo(QFile::decodeName(buf)).fileName();
|
||||
#elif defined(Q_OS_HAIKU)
|
||||
thread_info info;
|
||||
|
Loading…
x
Reference in New Issue
Block a user