aeb075704b5e2ae4757da69ca8d6eda0235d327d
GetSessionByPID(0) can fail with NO_SESSION_FOR_PID. More obscurely, if the session is abandoned, it can return NO_SUCH_SESSION. It is not clear that the latter was intended. The message associated with the former, hints that this was overlooked. We don't have a document enumerating the errors. Any specific error-handling in client code, e.g. translated messages, would also be liable to overlook the more obscure error code. I can't see any equivalent condition for GetUserByPID(0). On the other hand, the code did not return NO_USER_FOR_PID where it probably should. The relevant code is right next to that for GetSessionByPID(0), so it will be simpler to understand if both follow the same pattern.
systemd - System and Service Manager
Details
General information about systemd can be found in the systemd Wiki.
Information about build requirements are provided in the README file.
Consult our NEWS file for information about what's new in the most recent systemd versions.
Please see the HACKING file for information how to hack on systemd and test your modifications.
Please see our Contribution Guidelines for more information about filing GitHub Issues and posting GitHub Pull Requests.
When preparing patches for systemd, please follow our Coding Style Guidelines.
If you are looking for support, please contact our mailing list or join our IRC channel.
Languages
C
88.5%
Shell
5.7%
Python
4.6%
Meson
1.1%