]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
systemctl: show ExecStop= data after ExecStart= data 9624/head
authorLennart Poettering <lennart@poettering.net>
Tue, 17 Jul 2018 17:41:13 +0000 (19:41 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 23 Jul 2018 11:36:47 +0000 (13:36 +0200)
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

index d9bef997d593412fdabbb33c1e1016c75ae59089..93c1979d19abfcc32482f4e353e9a5a76f1a7e3b 100644 (file)
@@ -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)