]> git.ipfire.org Git - thirdparty/git.git/commitdiff
reftable/stack: stop using `sleep_millisec()`
authorPatrick Steinhardt <ps@pks.im>
Tue, 18 Feb 2025 09:20:48 +0000 (10:20 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 18 Feb 2025 18:55:38 +0000 (10:55 -0800)
Refactor our use of `sleep_millisec()` by open-coding it with poll(3p),
which is the current implementation of this function. Ideally, we'd use
a more direct way to sleep, but there is no equivalent to sleep(3p) that
would accept milliseconds as input.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
reftable/stack.c

index 08893fd454fe54b0f6bcdecc452c9d1687878997..6dac015b473a69e5bd6cbb64c6dc38e99e353fd3 100644 (file)
@@ -524,7 +524,7 @@ static int reftable_stack_reload_maybe_reuse(struct reftable_stack *st,
                fd = -1;
 
                delay = delay + (delay * reftable_rand()) / UINT32_MAX + 1;
-               sleep_millisec(delay);
+               poll(NULL, 0, delay);
        }
 
 out: