diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-07-11 02:22:46 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-07-11 02:22:46 +0200 |
commit | b574246b4f8e4eb86c29c38c7df47b541b68188a (patch) | |
tree | b42d2c6f432a64abe2dd6b23a580026212644cb5 /src/systemctl.c | |
parent | 7740296dcf581bbaaffa74f6f97a97d1def85e12 (diff) |
dbus: use private connections wherever possible
Diffstat (limited to 'src/systemctl.c')
-rw-r--r-- | src/systemctl.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/systemctl.c b/src/systemctl.c index 799f57d006..d90471773e 100644 --- a/src/systemctl.c +++ b/src/systemctl.c @@ -3056,7 +3056,7 @@ static int talk_upstart(void) { if (utmp_get_runlevel(&previous, NULL) < 0) previous = 'N'; - if (!(bus = dbus_connection_open("unix:abstract=/com/ubuntu/upstart", &error))) { + if (!(bus = dbus_connection_open_private("unix:abstract=/com/ubuntu/upstart", &error))) { if (dbus_error_has_name(&error, DBUS_ERROR_NO_SERVER)) { r = 0; goto finish; @@ -3120,8 +3120,10 @@ finish: if (reply) dbus_message_unref(reply); - if (bus) + if (bus) { + dbus_connection_close(bus); dbus_connection_unref(bus); + } dbus_error_free(&error); @@ -3444,8 +3446,10 @@ int main(int argc, char*argv[]) { finish: - if (bus) + if (bus) { + dbus_connection_close(bus); dbus_connection_unref(bus); + } dbus_error_free(&error); |