summaryrefslogtreecommitdiffstats
path: root/kdesktop/lock
diff options
context:
space:
mode:
authorSlávek Banko <[email protected]>2020-05-26 02:28:32 +0200
committerSlávek Banko <[email protected]>2020-05-26 10:45:46 +0200
commitbaed31ac7bc2b1abd38675f4e4d40aa8a8566bbb (patch)
treeaf4a364624f53b047db17a5d7c0d9c3448c3ceef /kdesktop/lock
parent8fc36c4ae2a860ca4ea004c49b39c394ed7fb1fa (diff)
downloadtdebase-baed31ac7bc2b1abd38675f4e4d40aa8a8566bbb.tar.gz
tdebase-baed31ac7bc2b1abd38675f4e4d40aa8a8566bbb.zip
Add FreeBSD / DragonFly specific /proc path for an executable file.
Signed-off-by: Slávek Banko <[email protected]> (cherry picked from commit 4ef8f959121b47c02683ce363892e8d3f8381d30)
Diffstat (limited to 'kdesktop/lock')
-rw-r--r--kdesktop/lock/main.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/kdesktop/lock/main.cc b/kdesktop/lock/main.cc
index d35c86957..c5993f4ac 100644
--- a/kdesktop/lock/main.cc
+++ b/kdesktop/lock/main.cc
@@ -332,9 +332,11 @@ int main( int argc, char **argv )
char fullpath[PATH_MAX];
#if defined(__dilos__)
snprintf(procpath, sizeof(procpath), "/proc/%d/path/a.out", pid);
-#else /* !__dilos__ */
+#elif defined(__FreeBSD__) || defined (__DragonFly__)
+ snprintf(procpath, sizeof(procpath), "/compat/linux/proc/%d/exe", pid);
+#else /* Linux way as default */
snprintf(procpath, sizeof(procpath), "/proc/%d/exe", pid);
-#endif /* __dilos__ */
+#endif
len = readlink( procpath, fullpath, sizeof(fullpath) );
if (len >= 0) {
fullpath[len] = 0;