From: Zbigniew Jędrzejewski-Szmek Date: Fri, 19 May 2017 11:52:00 +0000 (-0400) Subject: sd-login: fix querying machines when machined is not running X-Git-Tag: v234~181^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F5990%2Fhead;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/libsystemd/sd-login/sd-login.c b/src/libsystemd/sd-login/sd-login.c index 82a94bfd5c2..25dff7738fa 100644 --- a/src/libsystemd/sd-login/sd-login.c +++ b/src/libsystemd/sd-login/sd-login.c @@ -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;