]> git.ipfire.org Git - thirdparty/systemd.git/commit
process-util: make sure we don't report ppid == 0 35561/head
authorMike Yuan <me@yhndnzj.com>
Wed, 27 Nov 2024 23:40:11 +0000 (00:40 +0100)
committerMike Yuan <me@yhndnzj.com>
Wed, 11 Dec 2024 13:44:08 +0000 (14:44 +0100)
commit61263e143634db1eab916fa119f70ca15c1043db
tree54bb5e826cd8d772607a1a7373aa3d86d7d8b2d6
parent07612aab66dc771a9c7aca07c74940fb6447f3fa
process-util: make sure we don't report ppid == 0

Previously, if pid == 0 and we're PID 1, get_process_ppid()
would set ret to getppid(), i.e. 0, which is inconsistent
when pid is explicitly set to 1. Ensure we always handle
such case by returning -EADDRNOTAVAIL.
src/basic/process-util.c