pidref: hookup PID_AUTOMATIC special pid_t value with PidRef

The PID_AUTOMATIC value is now properly recognized by the PidRef logic
too. This needed some massaging of header includes, to ensure pidref.h
can access process-util.h's definitions and vice versa.
This commit is contained in:
Lennart Poettering
2024-10-14 12:44:36 +02:00
parent 8d24b2f017
commit de34ec188c
6 changed files with 52 additions and 6 deletions
+2 -1
View File
@@ -15,6 +15,7 @@
#include "format-util.h"
#include "macro.h"
#include "namespace-util.h"
#include "pidref.h"
#include "time-util.h"
#define procfs_file_alloca(pid, field) \
@@ -148,7 +149,7 @@ static inline bool sched_priority_is_valid(int i) {
return i >= 0 && i <= sched_get_priority_max(SCHED_RR);
}
#define PID_AUTOMATIC ((pid_t) INT_MIN) /* special value indicating "acquire pid from connection peer */
#define PID_AUTOMATIC ((pid_t) INT_MIN) /* special value indicating "acquire pid from connection peer" */
#define PID_INVALID ((pid_t) 0) /* default value for "invalid pid" */
static inline bool pid_is_valid(pid_t p) {