diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 82f4d0a29..ebc4717d1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -22,6 +22,13 @@ else() set(ENABLE_DETACHING 1) endif() +### Handle DragonFlyBSD here instead of using __DragonFly__ +IF(${CMAKE_SYSTEM_NAME} MATCHES "DragonFly") + set(HAVE_OS_DRAGONFLYBSD 1) +else() + set(HAVE_OS_DRAGONFLYBSD 0) +endif() + include(CheckIncludeFiles) configure_file(config-konsole.h.cmake diff --git a/src/ProcessInfo.cpp b/src/ProcessInfo.cpp index 26711f4f0..1ad05fdd4 100644 --- a/src/ProcessInfo.cpp +++ b/src/ProcessInfo.cpp @@ -635,7 +635,7 @@ private: return false; } -#if defined(__DragonFly__) +#if defined(HAVE_OS_DRAGONFLYBSD) setName(kInfoProc->kp_comm); setPid(kInfoProc->kp_pid); setParentPid(kInfoProc->kp_ppid); @@ -685,7 +685,7 @@ private: } virtual bool readCurrentDir(int aPid) { -#if defined(__DragonFly__) +#if defined(HAVE_OS_DRAGONFLYBSD) char buf[PATH_MAX]; int managementInfoBase[4]; size_t len; diff --git a/src/config-konsole.h.cmake b/src/config-konsole.h.cmake index 1bc0a4b2d..02f06e0c9 100644 --- a/src/config-konsole.h.cmake +++ b/src/config-konsole.h.cmake @@ -3,3 +3,6 @@ /* Defined if you want detaching enabled */ #cmakedefine ENABLE_DETACHING 1 + +/* Defined if on DragonFly BSD */ +#cmakedefine HAVE_OS_DRAGONFLYBSD 1