commit:     2c157d52e2da2373f0795272164faef6df31cd0d
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Dec  9 11:14:28 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Dec  9 11:14:28 2025 +0000
URL:        https://gitweb.gentoo.org/proj/steve.git/commit/?id=2c157d52

Round microseconds rather than truncating them

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 steve.cxx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/steve.cxx b/steve.cxx
index 2b32315..2181dbe 100644
--- a/steve.cxx
+++ b/steve.cxx
@@ -552,7 +552,7 @@ static void steve_poll(
 
 static void steve_timeout_to_timeval(struct timeval *out, double timeout) {
        out->tv_sec = trunc(timeout);
-       out->tv_usec = (timeout - out->tv_sec) * 1000000;
+       out->tv_usec = round((timeout - out->tv_sec) * 1000000);
 }
 
 static void steve_ioctl(

Reply via email to