mirror of
https://github.com/systemd/systemd.git
synced 2025-08-30 05:49:54 +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:
@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user