From 1d26e7c1d58e5e30742d95a1adea3dd9f4983f67 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 21 Nov 2025 12:53:20 +0100 Subject: [PATCH] bootctl: round the timeout up I think this is better: if I specify 0.5s, I'd be suprised if the menu didn't show up at all. --- src/bootctl/bootctl-set-efivar.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/bootctl/bootctl-set-efivar.c b/src/bootctl/bootctl-set-efivar.c index 360664b879f..82770dd6c6c 100644 --- a/src/bootctl/bootctl-set-efivar.c +++ b/src/bootctl/bootctl-set-efivar.c @@ -74,8 +74,10 @@ static int parse_timeout(const char *arg1, char16_t **ret_timeout, size_t *ret_t arg1 = NULL; } - if (!arg1) - xsprintf(buf, USEC_FMT, MIN(timeout / USEC_PER_SEC, UINT32_MAX)); + if (!arg1) { + timeout = DIV_ROUND_UP(timeout, USEC_PER_SEC); + xsprintf(buf, USEC_FMT, MIN(timeout, UINT32_MAX)); + } char16_t *encoded = utf8_to_utf16(arg1 ?: buf, SIZE_MAX); if (!encoded) -- 2.47.3