From 3e14d36a8a0eedbdd6de4b7944ad86696e78fadd Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 17 Jul 2018 19:41:13 +0200 Subject: [PATCH] systemctl: show ExecStop= data after ExecStart= data the service manager serializes ExecStop= execution data after ExecStart=, like it makes sense and how it should be expected. However, systemctl previously would reverse them when deserializing them locally, and thus show ExecStop= results before ExecStart= results. And that's confusing. Let's fix that. --- src/systemctl/systemctl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index d9bef997d5..93c1979d19 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -4548,6 +4548,7 @@ static int map_asserts(sd_bus *bus, const char *member, sd_bus_message *m, sd_bu static int map_exec(sd_bus *bus, const char *member, sd_bus_message *m, sd_bus_error *error, void *userdata) { _cleanup_free_ ExecStatusInfo *info = NULL; + ExecStatusInfo *last; UnitStatusInfo *i = userdata; int r; @@ -4559,13 +4560,16 @@ static int map_exec(sd_bus *bus, const char *member, sd_bus_message *m, sd_bus_e if (!info) return -ENOMEM; + LIST_FIND_TAIL(exec, i->exec, last); + while ((r = exec_status_info_deserialize(m, info)) > 0) { info->name = strdup(member); if (!info->name) return -ENOMEM; - LIST_PREPEND(exec, i->exec, info); + LIST_INSERT_AFTER(exec, i->exec, last, info); + last = info; info = new0(ExecStatusInfo, 1); if (!info)