Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/dsgapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ QByteArray DSGApplication::getId(qint64 pid)

int pidfd = syscall(SYS_pidfd_open, pid, 0);
if (pidfd < 0) {
qCWarning(dsgApp) << "pidfd open failed:" << strerror(errno);
qCWarning(dsgApp) << "pidfd open failed:" << strerror(errno) << ", the pid:" << pid;
return QByteArray();
}

Expand All @@ -109,6 +109,8 @@ QByteArray DSGApplication::getId(qint64 pid)
"org.desktopspec.ApplicationManager1");

QDBusReply<QString> reply = infc.call("Identify", QVariant::fromValue(QDBusUnixFileDescriptor(pidfd)));
// see QDBusUnixFileDescriptor: The original file descriptor is not touched and must be closed by the user.
close(pidfd);

if (!reply.isValid()) {
qCWarning(dsgApp) << "Identify from AM failed." << reply.error().message();
Expand Down
Loading