]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-login: fix querying machines when machined is not running 5990/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 19 May 2017 11:52:00 +0000 (07:52 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 19 May 2017 11:52:00 +0000 (07:52 -0400)
We should not leak the internal error from missing directory and treat
that case the same as no machines.

src/libsystemd/sd-login/sd-login.c

index 82a94bfd5c279ac57402e80ae4ccb337701effd0..25dff7738fa1ab9dbb60ea6c5836ad4a56287117 100644 (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;