1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-07 09:56:51 +03:00

sd-login: fix return value of sd_pid_get_user_unit

E.g. "/user.slice/user-1000.slice/session-15.scope" would cause -ENXIO to be
returned.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2017-05-18 22:11:08 -04:00
parent 19d64d10c0
commit d440fb97ba

View File

@ -74,11 +74,13 @@ _public_ int sd_pid_get_unit(pid_t pid, char **unit) {
}
_public_ int sd_pid_get_user_unit(pid_t pid, char **unit) {
int r;
assert_return(pid >= 0, -EINVAL);
assert_return(unit, -EINVAL);
return cg_pid_get_user_unit(pid, unit);
r = cg_pid_get_user_unit(pid, unit);
return r == -ENXIO ? -ENODATA : r;
}
_public_ int sd_pid_get_machine_name(pid_t pid, char **name) {