From: Karel Zak Date: Wed, 29 Jan 2025 11:38:46 +0000 (+0100) Subject: scriptreplay: fix compiler warning X-Git-Tag: v2.42-start~72 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=12053b1a674384e95bc70b0ee9521851cd2b40cc;p=thirdparty%2Futil-linux.git scriptreplay: fix compiler warning compiler warning: expected 'struct timeval * restrict' but argument is of type 'const struct timeval *' On Linux, select() modifies timeout, so the timeout cannot be 'const'. Signed-off-by: Karel Zak --- diff --git a/term-utils/scriptreplay.c b/term-utils/scriptreplay.c index 1453d5bbb..77f057035 100644 --- a/term-utils/scriptreplay.c +++ b/term-utils/scriptreplay.c @@ -107,7 +107,13 @@ delay_for(const struct timeval *delay) break; } #else - select(0, NULL, NULL, NULL, delay); + { + struct timeval timeout; + + /* On Linux, select() modifies timeout */ + memcpy(&timeout, delay, sizeof(struct timeval)); + select(0, NULL, NULL, NULL, &timeout); + } #endif }