#44074: select timeval inaccuracy Open Date: 2022-03-11 05:17 Last Update: 2022-03-11 11:15 URL for this Ticket: https://osdn.net//projects/mingw/ticket/44074 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=3917&tid=44074 --------------------------------------------------------------------- Last Changes/Comment on this Ticket: 2022-03-11 11:15 Updated by: keith Comment: I'm sorry, but you simply haven't provided (anywhere near) enough information, to allow us to effectively help with this. Please: Fix the formatting of your original ticket submission (see the OSDN WikiSyntax guide). Read our bug reporting guide. Provide a small, self-contained, compilable example, to demonstrate, and allow us to reproduce your issue. --------------------------------------------------------------------- Ticket Status: Reporter: mdblack98 Owner: (None) Type: Issues Status: Open Priority: 5 - Medium MileStone: (None) Component: (None) Severity: 5 - Medium Resolution: None --------------------------------------------------------------------- Ticket details: I'm the maintainer of Hamlib. I think this is recent behavior Even thought the timeval for the select statement is 1 second exactly it ends up being almost 2 seconds. You can see from the timing on the debug messages that the 2022-03-10T23:15:03.068356-0600: ../../src/src/iofunc.c(721) trace 2022-03-10T23:15:03.068356-0600: port_wait_for_data_direct: sec=1, usec=0 2022-03-10T23:15:05.021620-0600: port_wait_for_data_direct: after port_select 2022-03-10T23:15:05.021620-0600: read_string_generic(): Timed out 1.953 seconds after 0 chars, direct=1 MINGW64_NT-10.0-22000 DESKTOP-VP5ISPC 3.3.3-341.x86_64 2022-01-18 13:00 UTC x86_64 Msys static int port_wait_for_data_direct(hamlib_port_t *p) { fd_set rfds, efds; int fd = p->fd; struct timeval tv, tv_timeout; int result; TRACE; tv_timeout.tv_sec = p->timeout / 1000; tv_timeout.tv_usec = (p->timeout % 1000) * 1000; rig_debug(RIG_DEBUG_VERBOSE, "%s: sec=%ld, usec=%ld\n", func, tv_timeout.tv_sec, tv_timeout.tv_usec); tv = tv_timeout; /* select may have updated it */ FD_ZERO(&rfds); FD_SET(fd, &rfds); efds = rfds; result = port_select(p, fd + 1, &rfds, NULL, &efds, &tv, 1); rig_debug(RIG_DEBUG_VERBOSE, "%s: after port_select\n", func); -- Ticket information of MinGW - Minimalist GNU for Windows project MinGW - Minimalist GNU for Windows Project is hosted on OSDN Project URL: https://osdn.net/projects/mingw/ OSDN: https://osdn.net URL for this Ticket: https://osdn.net/projects/mingw/ticket/44074 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=3917&tid=44074