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

OSAL not reporting correct error string if clock_getres() call in OS_Posix_TimeBaseAPI_Impl_Init fails #686

Closed
ericgilligan-nasa opened this issue Dec 11, 2020 · 0 comments · Fixed by #687 or #690
Assignees
Labels
Milestone

Comments

@ericgilligan-nasa
Copy link

OS_DEBUG("failed in clock_getres: %s\n", strerror(status));

From clock_getres man pages:

clock_gettime(), clock_settime() and clock_getres() return 0 for success, or -1 for failure (in which case errno is set appropriately).

The return value of clock_getres() is just 0 or -1. If it returns -1 in the event of a failure, it sets errno, so the OS_DEBUG line should use strerror(errno), not strerror(status), otherwise it always reports:

OS_Posix_TimeBaseAPI_Impl_Init():222:failed in clock_getres: Unknown error -1
@skliper skliper added the bug label Dec 14, 2020
@skliper skliper added this to the 6.0.0 milestone Dec 14, 2020
@skliper skliper self-assigned this Dec 14, 2020
skliper added a commit to skliper/osal that referenced this issue Dec 14, 2020
astrogeco added a commit that referenced this issue Dec 18, 2020
Fix #686, Use errno in clock_getres error reporting
jphickey pushed a commit to jphickey/osal that referenced this issue Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants