Lines 9-14
Link Here
|
9 |
|
9 |
|
10 |
#pragma once |
10 |
#pragma once |
11 |
|
11 |
|
|
|
12 |
#if defined(__FreeBSD__) |
13 |
#include <limits.h> |
14 |
#include <sys/sysctl.h> |
15 |
#endif |
12 |
// cmake stuff |
16 |
// cmake stuff |
13 |
#include "config-kwin.h" |
17 |
#include "config-kwin.h" |
14 |
// kwin |
18 |
// kwin |
Lines 19-25
Link Here
|
19 |
#include <QProcess> |
23 |
#include <QProcess> |
20 |
// KF |
24 |
// KF |
21 |
#include <KApplicationTrader> |
25 |
#include <KApplicationTrader> |
22 |
|
|
|
23 |
namespace KWin |
26 |
namespace KWin |
24 |
{ |
27 |
{ |
25 |
|
28 |
|
Lines 66-73
static inline QStringList fetchRestrictedDBusInterface
Link Here
|
66 |
|
69 |
|
67 |
static inline QStringList fetchRestrictedDBusInterfacesFromPid(const uint pid) |
70 |
static inline QStringList fetchRestrictedDBusInterfacesFromPid(const uint pid) |
68 |
{ |
71 |
{ |
|
|
72 |
#ifdef __FreeBSD__ |
73 |
static int pathname[] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 }; |
74 |
pathname[3] = pid; |
75 |
size_t path_size = PATH_MAX; |
76 |
char *executablePath =(char*)malloc( path_size ); |
77 |
sysctl( pathname, sizeof(pathname)/sizeof(pathname[0]), executablePath, &path_size, NULL, 0 ); |
78 |
#else |
69 |
const auto executablePath = QFileInfo(QStringLiteral("/proc/%1/exe").arg(pid)).symLinkTarget(); |
79 |
const auto executablePath = QFileInfo(QStringLiteral("/proc/%1/exe").arg(pid)).symLinkTarget(); |
|
|
80 |
#endif |
70 |
return fetchProcessServiceField(executablePath, s_dbusRestrictedInterfaceName); |
81 |
return fetchProcessServiceField(executablePath, s_dbusRestrictedInterfaceName); |
|
|
82 |
|
71 |
} |
83 |
} |
72 |
|
84 |
|
73 |
} // namespace |
85 |
} // namespace |