1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-07 21:18:41 +03:00

sd-login: fix querying machines when machined is not running

We should not leak the internal error from missing directory and treat
that case the same as no machines.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2017-05-19 07:52:00 -04:00
parent 171f8f591f
commit 0543105b0f

View File

@ -854,6 +854,10 @@ _public_ int sd_get_machine_names(char ***machines) {
assert_return(machines, -EINVAL);
r = get_files_in_directory("/run/systemd/machines/", &l);
if (r == -ENOENT) {
*machines = NULL;
return 0;
}
if (r < 0)
return r;