From 5715138a96fb04245bcd6bea4b3094e424e68272 Mon Sep 17 00:00:00 2001 From: Arnaud Ferraris Date: Fri, 11 Dec 2020 15:09:10 +0100 Subject: [PATCH] suspend: reset sleep inhibitor if already present upon resume --- src/suspend.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/suspend.c b/src/suspend.c index 8296696..873a985 100644 --- a/src/suspend.c +++ b/src/suspend.c @@ -66,7 +66,8 @@ static void take_inhibitor(struct EG25Manager *manager) { GVariant *variant_arg; - g_assert(manager->suspend_inhibit_fd == -1); + if(manager->suspend_inhibit_fd != -1) + drop_inhibitor(manager); variant_arg = g_variant_new ("(ssss)", "sleep", "eg25manager", "eg25manager needs to prepare modem for sleep", "delay");