chiark / gitweb /
util: make asynchronous_close() really work like an asynchronous version of safe_close()
[elogind.git] / src / systemctl / systemctl.c
index 540b4a64c1f5077f7c5364fb2bb37f5419ec4d97..072f615ad547f18c152f45ec29d8a32a9460c8c4 100644 (file)
@@ -1350,6 +1350,10 @@ static int list_unit_files(sd_bus *bus, char **args) {
                 }
 
                 n_units = hashmap_size(h);
+
+                if (n_units == 0)
+                        return 0;
+
                 units = new(UnitFileList, n_units);
                 if (!units) {
                         unit_file_list_free(h);
@@ -4827,7 +4831,7 @@ static int switch_root(sd_bus *bus, char **args) {
                 const char *root_systemd_path = NULL, *root_init_path = NULL;
 
                 root_systemd_path = strappenda(root, "/" SYSTEMD_BINARY_PATH);
-                root_init_path = strappenda3(root, "/", init);
+                root_init_path = strappenda(root, "/", init);
 
                 /* If the passed init is actually the same as the
                  * systemd binary, then let's suppress it. */