On 29 December 2016 at 14:54, Felipe Sateler <fsate...@debian.org> wrote:
> On 26 December 2016 at 06:18, Michael Biebl <bi...@debian.org> wrote:
>>
>> Am 25.12.2016 um 22:32 schrieb Felipe Sateler:
>> > PR 4978 was closed in favor of 4972. However, it has not been merged
>> > yet. The patch is small so at least I don't have a problem with
>> > backporting. However, we prefer patches to be merged upstream, so
>> > we'll wait until the PR is merged. Feel free to ping again if the PR
>> > is merged and there has been no activity.
>>
>> Nod, I have no objection pulling that patch once merged.
>
> So, PR 4972 was merged. This can be thus backported (I've not done so
> yet because I'm not at my debian laptop). I think a related PR is
> 4979, it might be a good idea to backport that one as well too.
>
> https://github.com/systemd/systemd/pull/4979

The patch in 4972 does not apply cleanly, because it depends on
another pr[1] that introduces new dbus calls. I'm not sure I want to
backport that as well, so I adpated the patch. Guido, would you like
to try the attached patch to see if the backport fixes the problem for
you?

[1] https://github.com/systemd/systemd/pull/4795


-- 

Saludos,
Felipe Sateler
diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c
index 7b9be3b42..e929570f8 100644
--- a/src/machine/machinectl.c
+++ b/src/machine/machinectl.c
@@ -242,23 +242,19 @@ 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;
+                machines[n_machines].name = name;
+                machines[n_machines].class = class;
+                machines[n_machines].service = service;
+
                 r = get_os_release_property(bus, name,
                                 "ID\0" "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)

Reply via email to