]> git.ipfire.org Git - thirdparty/systemd.git/commit
process-util: be more careful with pidfd_get_pid() special cases
authorLennart Poettering <lennart@poettering.net>
Fri, 14 Apr 2023 15:47:43 +0000 (17:47 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Mon, 17 Apr 2023 20:38:41 +0000 (21:38 +0100)
commit38cdd08b22565f861ae6dd83b02bc6b189ba2ef5
treed87876a33376f2011ac02b001747c00eac2a795a
parent360c9cdc65dc44a9d263e9f7433e7a6fbff15c9d
process-util: be more careful with pidfd_get_pid() special cases

Let's be more careful with generating error codes for (expected) error
causes.

This does not introduce new error conditions, it just changes what we
return under specific cases, to make things nicely recognizable in each
case. Most importantly this detects if fdinfo reports a pid of "-1" for
pidfds with processes that are already reaped (and thus have no PID
anymore)

None of our current users care about these error codes, but let's get
this right for the future.
src/basic/process-util.c