1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
From 4e5d62200fceb75a7867005c29103aa502733270 Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Mon, 23 Dec 2024 16:13:31 +0100
Subject: [PATCH] Adopt API changes for procps-ng 4.0.5 (#565)
The 'info' parameter was dropped in 'VAL' macros.
https://gitlab.com/procps-ng/procps/-/commit/967fdcfb06e20aad0f31073474cb94545c9bdea5
---
CMakeLists.txt | 3 +++
lxqt-session/src/procreaper.cpp | 8 ++++++++
2 files changed, 11 insertions(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 932f7894..855a35f9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -39,6 +39,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()
diff --git a/lxqt-session/src/procreaper.cpp b/lxqt-session/src/procreaper.cpp
index ea614530..8069c606 100644
--- a/lxqt-session/src/procreaper.cpp
+++ b/lxqt-session/src/procreaper.cpp
@@ -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);
}
}
|