Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix math in OS_DoSelect #857

Closed
skliper opened this issue Mar 10, 2021 · 0 comments · Fixed by #898 or #917
Closed

Fix math in OS_DoSelect #857

skliper opened this issue Mar 10, 2021 · 0 comments · Fixed by #898 or #917
Assignees
Milestone

Comments

@skliper
Copy link
Contributor

skliper commented Mar 10, 2021

Is your feature request related to a problem? Please describe.
imagine simplified example with decimal value: now = 0.8, and end == 1.2. that means we should sleep for 0.4 seconds. using the above logic, we get:

tv.tv_sec = 1
tv.tv_usec = -6

so, tv.tv_usec < 0:

tv.tv_usec now becomes 4 (correct!)
tv.tv_sec now becomes 2 (huh?)

so now we wait 2.4 seconds instead of 0.4

Maybe we need a --tv.tv_sec?

Describe the solution you'd like
Confirm/fix if needed. Remove bug if not real.

Describe alternatives you've considered
None

Additional context
None

Requester Info
Jacob Hageman - NASA/GSFC, OSAL code review

@skliper skliper added this to the 6.0.0 milestone Mar 10, 2021
@skliper skliper added bug and removed enhancement labels Mar 10, 2021
jphickey added a commit to jphickey/osal that referenced this issue Mar 12, 2021
When calculating the relative time interval for the select() call,
the increment should have been a decrement.

This also adds a UT case that specifically exercises the carryover
described.
jphickey added a commit to jphickey/osal that referenced this issue Mar 12, 2021
When calculating the relative time interval for the select() call,
the increment should have been a decrement.

This also adds a UT case that specifically exercises the carryover
described.
astrogeco added a commit to astrogeco/osal that referenced this issue Mar 19, 2021
Fix nasa#857, correct interval calculation in DoSelect

When calculating the relative time interval for the select() call,
the increment should have been a decrement.

This also adds a UT case that specifically exercises the carryover
described.
astrogeco added a commit to astrogeco/osal that referenced this issue Mar 22, 2021
Fix nasa#857, correct interval calculation in DoSelect

When calculating the relative time interval for the select() call,
the increment should have been a decrement.

This also adds a UT case that specifically exercises the carryover
described.
jphickey pushed a commit to jphickey/osal that referenced this issue Aug 10, 2022
Fix nasa#823, avoid infinite loop in CDS registry find
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants