summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Berg <bberg@redhat.com>2022-07-12 14:15:22 +0200
committerBenjamin Berg <bberg@redhat.com>2022-07-12 16:53:53 +0200
commitf64210df4ae8a032130f1dc8a68bbf7478d17b29 (patch)
tree511eb30aa70406bb03fab9a8a9fafe39c391eb77
parent5fea66f4111611f00d691aa28b30b16a25548567 (diff)
downloadupower-f64210df4ae8a032130f1dc8a68bbf7478d17b29.tar.gz
daemon: Reevaluate polling timeout after resume
When polling is resumed the timeout needs to be reevaluated. This requires running the polling handler once (in the next mainloop iteration). Set the ready time to zero to ensure this is happening. Without this, we would be stuck without actually polling until we get a uevent from the kernel on one of the power supplies. Fixes: #198
-rw-r--r--src/up-daemon.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/up-daemon.c b/src/up-daemon.c
index aa89d7d..64de1cd 100644
--- a/src/up-daemon.c
+++ b/src/up-daemon.c
@@ -926,6 +926,8 @@ up_daemon_resume_poll (UpDaemon *daemon)
g_debug ("Polling will be resumed");
daemon->priv->poll_paused = FALSE;
+
+ g_source_set_ready_time (daemon->priv->poll_source, 0);
}
void