diff options
Diffstat (limited to 'src/machine/machinectl.c')
-rw-r--r-- | src/machine/machinectl.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c index f85ef5b6ec..31a40d47c3 100644 --- a/src/machine/machinectl.c +++ b/src/machine/machinectl.c @@ -243,14 +243,16 @@ static int list_machines(int argc, char *argv[], void *userdata) { if (name[0] == '.' && !arg_all) continue; - if (!GREEDY_REALLOC(machines, n_allocated, n_machines + 1)) { + if (!GREEDY_REALLOC0(machines, n_allocated, n_machines + 1)) { r = log_oom(); goto out; } - machines[n_machines].os = NULL; - machines[n_machines].version_id = NULL; - r = call_get_os_release( + machines[n_machines].name = name; + machines[n_machines].class = class; + machines[n_machines].service = service; + + (void) call_get_os_release( bus, "GetMachineOSRelease", name, @@ -258,12 +260,6 @@ static int list_machines(int argc, char *argv[], void *userdata) { "VERSION_ID\0", &machines[n_machines].os, &machines[n_machines].version_id); - if (r < 0) - goto out; - - machines[n_machines].name = name; - machines[n_machines].class = class; - machines[n_machines].service = service; l = strlen(name); if (l > max_name) @@ -2670,9 +2666,9 @@ static int help(int argc, char *argv[], void *userdata) { " -o --output=STRING Change journal output mode (short,\n" " short-monotonic, verbose, export, json,\n" " json-pretty, json-sse, cat)\n" - " --verify=MODE Verification mode for downloaded images (no,\n" + " --verify=MODE Verification mode for downloaded images (no,\n" " checksum, signature)\n" - " --force Download image even if already exists\n\n" + " --force Download image even if already exists\n\n" "Machine Commands:\n" " list List running VMs and containers\n" " status NAME... Show VM/container details\n" |