From: Zbigniew Jędrzejewski-Szmek Date: Fri, 21 Nov 2025 11:53:20 +0000 (+0100) Subject: bootctl: round the timeout up X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d26e7c1d58e5e30742d95a1adea3dd9f4983f67;p=thirdparty%2Fsystemd.git 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. --- 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)