]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/libsystemd/sd-bus/busctl.c
systemctl: make sure we terminate the bus connection first, and then close the pager...
[thirdparty/systemd.git] / src / libsystemd / sd-bus / busctl.c
index bfe967bfb05233eb542ce89c7b4210bb1065e1f0..eb042e9c812bd8961e25bdda625de4b1e7481c77 100644 (file)
@@ -1987,7 +1987,7 @@ static int busctl_main(sd_bus *bus, int argc, char *argv[]) {
 }
 
 int main(int argc, char *argv[]) {
-        _cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
+        sd_bus *bus = NULL;
         int r;
 
         log_parse_environment();
@@ -2078,6 +2078,7 @@ int main(int argc, char *argv[]) {
         r = busctl_main(bus, argc, argv);
 
 finish:
+        sd_bus_flush_close_unref(bus);
         pager_close();
 
         strv_free(arg_matches);