Skip to content

Commit

Permalink
Adopt API changes for procps-ng 4.0.5 (#565)
Browse files Browse the repository at this point in the history
  • Loading branch information
eworm-de authored Dec 23, 2024
1 parent f1af1c4 commit 4e5d622
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
message(STATUS "Using PROCPS -> ${PROCPS_MODULE_NAME} v${PROCPS_VERSION}")
if (PROCPS_VERSION VERSION_GREATER_EQUAL 4.0.0)
add_definitions("-DUSING_LIBPROC2")
if (PROCPS_VERSION VERSION_GREATER_EQUAL 4.0.5)
add_definitions("-DUSING_LIBPROC2_1")
endif()
endif()
endif()

Expand Down
8 changes: 8 additions & 0 deletions lxqt-session/src/procreaper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,18 @@ void ProcReaper::stop(const std::set<int64_t> & excludedPids)
pids_stack * stack = nullptr;
while ((stack = procps_pids_get(info, PIDS_FETCH_TASKS_ONLY)))
{
# if defined(USING_LIBPROC2_1)
const int ppid = PIDS_VAL(rel_ppid, s_int, stack);
# else
const int ppid = PIDS_VAL(rel_ppid, s_int, stack, info);
# endif
if (ppid == my_pid)
{
# if defined(USING_LIBPROC2_1)
const int tgid = PIDS_VAL(rel_tgid, s_int, stack);
# else
const int tgid = PIDS_VAL(rel_tgid, s_int, stack, info);
# endif
children.push_back(tgid);
}
}
Expand Down

0 comments on commit 4e5d622

Please sign in to comment.