X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;ds=sidebyside;f=src%2Finitctl.c;h=83a560a14a538e305d16bb8f45d85cc633fa98f4;hb=76143638fdabee59dcd5db81fe46c900299da425;hp=7241acb8dfe59771c9d5c930eeb1aeaecbaccc2e;hpb=a822056bca49a63cb832230af22f789c5ab5b856;p=elogind.git diff --git a/src/initctl.c b/src/initctl.c index 7241acb8d..83a560a14 100644 --- a/src/initctl.c +++ b/src/initctl.c @@ -232,7 +232,7 @@ static void server_done(Server *s) { close_nointr_nofail(s->epoll_fd); if (s->bus) { - dbus_connection_set_exit_on_disconnect(s->bus, FALSE); + dbus_connection_close(s->bus); dbus_connection_unref(s->bus); } } @@ -297,14 +297,10 @@ static int server_init(Server *s, unsigned n_sockets) { s->n_fifos ++; } - if (!(s->bus = dbus_connection_open("unix:abstract=/org/freedesktop/systemd1/private", &error))) { + if (bus_connect(DBUS_BUS_SYSTEM, &s->bus, NULL, &error) < 0) { log_error("Failed to get D-Bus connection: %s", error.message); goto fail; } - if ((r = bus_check_peercred(s->bus)) < 0) { - log_error("Bus connection failed peer credential check: %s", strerror(-r)); - goto fail; - } return 0;