From baed31ac7bc2b1abd38675f4e4d40aa8a8566bbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Tue, 26 May 2020 02:28:32 +0200 Subject: Add FreeBSD / DragonFly specific /proc path for an executable file. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko (cherry picked from commit 4ef8f959121b47c02683ce363892e8d3f8381d30) --- kdesktop/lock/main.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'kdesktop') 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; -- cgit v1.2.1