Merge pull request #7865 from fbuihuu/restore-termination-of-bus-connection-first
Restore termination of bus connection first
This commit is contained in:
commit
47e5995a38
|
@ -2017,7 +2017,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();
|
||||
|
@ -2113,6 +2113,9 @@ int main(int argc, char *argv[]) {
|
|||
r = busctl_main(bus, argc, argv);
|
||||
|
||||
finish:
|
||||
/* make sure we terminate the bus connection first, and then close the
|
||||
* pager, see issue #3543 for the details. */
|
||||
sd_bus_flush_close_unref(bus);
|
||||
pager_close();
|
||||
|
||||
strv_free(arg_matches);
|
||||
|
|
|
@ -595,7 +595,7 @@ static int localectl_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;
|
||||
|
||||
setlocale(LC_ALL, "");
|
||||
|
@ -615,6 +615,9 @@ int main(int argc, char*argv[]) {
|
|||
r = localectl_main(bus, argc, argv);
|
||||
|
||||
finish:
|
||||
/* make sure we terminate the bus connection first, and then close the
|
||||
* pager, see issue #3543 for the details. */
|
||||
sd_bus_flush_close_unref(bus);
|
||||
pager_close();
|
||||
|
||||
return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
|
||||
|
|
|
@ -1584,7 +1584,7 @@ static int loginctl_main(int argc, char *argv[], sd_bus *bus) {
|
|||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
|
||||
sd_bus *bus = NULL;
|
||||
int r;
|
||||
|
||||
setlocale(LC_ALL, "");
|
||||
|
@ -1607,6 +1607,9 @@ int main(int argc, char *argv[]) {
|
|||
r = loginctl_main(argc, argv, bus);
|
||||
|
||||
finish:
|
||||
/* make sure we terminate the bus connection first, and then close the
|
||||
* pager, see issue #3543 for the details. */
|
||||
sd_bus_flush_close_unref(bus);
|
||||
pager_close();
|
||||
polkit_agent_close();
|
||||
|
||||
|
|
|
@ -3143,7 +3143,7 @@ static int machinectl_main(int argc, char *argv[], sd_bus *bus) {
|
|||
}
|
||||
|
||||
int main(int argc, char*argv[]) {
|
||||
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
|
||||
sd_bus *bus = NULL;
|
||||
int r;
|
||||
|
||||
setlocale(LC_ALL, "");
|
||||
|
@ -3166,6 +3166,9 @@ int main(int argc, char*argv[]) {
|
|||
r = machinectl_main(argc, argv, bus);
|
||||
|
||||
finish:
|
||||
/* make sure we terminate the bus connection first, and then close the
|
||||
* pager, see issue #3543 for the details. */
|
||||
sd_bus_flush_close_unref(bus);
|
||||
pager_close();
|
||||
polkit_agent_close();
|
||||
|
||||
|
|
|
@ -1563,7 +1563,7 @@ finish:
|
|||
}
|
||||
|
||||
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();
|
||||
|
@ -1670,6 +1670,9 @@ int main(int argc, char* argv[]) {
|
|||
}
|
||||
|
||||
finish:
|
||||
/* make sure we terminate the bus connection first, and then close the
|
||||
* pager, see issue #3543 for the details. */
|
||||
bus = sd_bus_flush_close_unref(bus);
|
||||
pager_close();
|
||||
|
||||
free(arg_mount_what);
|
||||
|
|
|
@ -473,7 +473,7 @@ static int timedatectl_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;
|
||||
|
||||
setlocale(LC_ALL, "");
|
||||
|
@ -493,6 +493,9 @@ int main(int argc, char *argv[]) {
|
|||
r = timedatectl_main(bus, argc, argv);
|
||||
|
||||
finish:
|
||||
/* make sure we terminate the bus connection first, and then close the
|
||||
* pager, see issue #3543 for the details. */
|
||||
sd_bus_flush_close_unref(bus);
|
||||
pager_close();
|
||||
|
||||
return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
|
||||
|
|
Loading…
Reference in a new issue