From 91442e22eada3ef1df8a78a72be769c4c38f4911 Mon Sep 17 00:00:00 2001 From: Hector Martin Date: Thu, 2 Nov 2023 16:00:09 +0900 Subject: [PATCH] afk: Increase timeout from 500 loops to 500ms (time-based) This should hopefully solve the reliability issues here. Signed-off-by: Hector Martin --- src/afk.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/afk.c b/src/afk.c index a47b72558..53c28dc00 100644 --- a/src/afk.c +++ b/src/afk.c @@ -722,7 +722,9 @@ int afk_epic_start_interface(afk_epic_ep_t *epic, void *intf, int expected, size break; } - for (int tries = 0; tries < 500; tries += 1) { + u64 timeout = timeout_calculate(500000); + + while (!timeout_expired(timeout)) { s64 epic_unit = -1; char *epic_name = NULL; char *epic_class = NULL;