]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
busctl: monitor - ignore the final NameLost message 6031/head
authorTom Gundersen <teg@jklm.no>
Thu, 25 May 2017 14:10:37 +0000 (16:10 +0200)
committerTom Gundersen <teg@jklm.no>
Thu, 25 May 2017 15:37:50 +0000 (17:37 +0200)
Commit f5938e8ff3cf5b6fadd6b440b3b10fc0e5a64733 started dropping all
messages before we become a monitor, but the last one was getting
through.

This drops also the last NameLost message, which indicatse the switch
from a regular peer to a monitor.

src/busctl/busctl.c

index 438e1ace93073b35f6164187e236b41f303e82f6..b38d6c7267aacea2e543d4c494663037702fbe75 100644 (file)
@@ -1166,10 +1166,10 @@ static int monitor(sd_bus *bus, char *argv[], int (*dump)(sd_bus_message *m, FIL
                         if (r < 0)
                                 return log_error_errno(r, "Failed to read lost name: %m");
 
-                        if (!streq(name, unique_name))
-                                continue;
+                        if (streq(name, unique_name))
+                                is_monitor = true;
 
-                        is_monitor = true;
+                        continue;
                 }
 
                 if (m) {