summaryrefslogtreecommitdiffhomepage
path: root/opentrack-compat
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-08-14 09:28:42 +0200
committerStanislaw Halik <sthalik@misaki.pl>2015-08-14 09:28:42 +0200
commit1ebfd95dce50db4fa9523a26aba1f80e4ff5db52 (patch)
tree00732314f4845bbd1320a227087a7ee9d03d428f /opentrack-compat
parent413e6fef09190b0ddc1a110415d964f88f332655 (diff)
fix Linux game detection code
Issue: #181
Diffstat (limited to 'opentrack-compat')
-rwxr-xr-xopentrack-compat/process-list.hpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/opentrack-compat/process-list.hpp b/opentrack-compat/process-list.hpp
index f3388c4f..6b139739 100755
--- a/opentrack-compat/process-list.hpp
+++ b/opentrack-compat/process-list.hpp
@@ -124,7 +124,6 @@ static QStringList get_all_executable_names()
#elif defined __linux
-// link to procps
#include <proc/readproc.h>
#include <cerrno>
template<typename = void>
@@ -139,10 +138,13 @@ static QStringList get_all_executable_names()
}
for (int i = 0; procs[i]; i++)
{
- auto& proc = *procs[i];
- ret.append(proc.cmd);
+ // note, wine sets argv[0] so no parsing like in OSX case
+ auto proc = procs[i];
+ if (proc->cmdline && proc->cmdline[0])
+ ret.append(proc->cmdline[0]);
+ freeproc(procs[i]);
}
- freeproctab(procs);
+ free(procs);
return ret;
}