diff options
author | Lennart Poettering <lennart@poettering.net> | 2024-05-23 09:46:04 +0200 |
---|---|---|
committer | Luca Boccassi <bluca@debian.org> | 2024-06-12 00:17:38 +0200 |
commit | ec8bbd8adb9463471803aadd9a8ba2a326d7a49d (patch) | |
tree | 6afe19876525da59f131e668b2f17a66db589479 /src/locale | |
parent | hostnamed: don't allow hostnamed to exit on idle if varlink connections are s... (diff) | |
download | systemd-ec8bbd8adb9463471803aadd9a8ba2a326d7a49d.tar.xz systemd-ec8bbd8adb9463471803aadd9a8ba2a326d7a49d.zip |
tree-wide: never consider service idle if polkit authentication is still pending
Let's be correct on this.
Diffstat (limited to 'src/locale')
-rw-r--r-- | src/locale/localed.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/locale/localed.c b/src/locale/localed.c index c0d104578d..062744519d 100644 --- a/src/locale/localed.c +++ b/src/locale/localed.c @@ -622,6 +622,12 @@ static int connect_bus(Context *c, sd_event *event, sd_bus **_bus) { return 0; } +static bool context_check_idle(void *userdata) { + Context *c = ASSERT_PTR(userdata); + + return hashmap_isempty(c->polkit_registry); +} + static int run(int argc, char *argv[]) { _cleanup_(context_clear) Context context = {}; _cleanup_(sd_event_unrefp) sd_event *event = NULL; @@ -662,7 +668,13 @@ static int run(int argc, char *argv[]) { if (r < 0) log_warning_errno(r, "Failed to send readiness notification, ignoring: %m"); - r = bus_event_loop_with_idle(event, bus, "org.freedesktop.locale1", DEFAULT_EXIT_USEC, NULL, NULL); + r = bus_event_loop_with_idle( + event, + bus, + "org.freedesktop.locale1", + DEFAULT_EXIT_USEC, + context_check_idle, + &context); if (r < 0) return log_error_errno(r, "Failed to run event loop: %m"); |