Skip to content

Commit

Permalink
Enable sd_bus_set_exit_on_disconnect
Browse files Browse the repository at this point in the history
It does not make sense to keep running when we
lose connection to one of our dbus connections.

systemd/systemd#15879
  • Loading branch information
rfjakob committed May 21, 2020
1 parent c33f150 commit c47d4b2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ int main(int argc, char* argv[])
const char* a = NULL;
sd_bus_get_address(user_bus, &a);
debug("ok: %s\n", a);
sd_bus_set_exit_on_disconnect(user_bus, 1);
}

debug("connecting to d-bus system bus: ");
Expand All @@ -96,6 +97,7 @@ int main(int argc, char* argv[])
const char* a = NULL;
sd_bus_get_address(system_bus, &a);
debug("ok: %s\n", a);
sd_bus_set_exit_on_disconnect(system_bus, 1);
}

// Connect D-Bus signal handler
Expand Down

0 comments on commit c47d4b2

Please sign in to comment.