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

utils: Fix incorrect gettimeofday() return value check #5212

Merged
merged 1 commit into from
Feb 26, 2025

Conversation

ShubhamDesai
Copy link
Contributor

This PR corrects the return value check for gettimeofday() in utils/timer/main.c to align with the POSIX specification. According to POSIX, gettimeofday() returns 0 on success, while any nonzero value indicates failure. Therefore, checking specifically for -1 is incorrect.
The gettimeofday() function shall return 0 and no value shall be reserved to indicate an error
This pull request is in reference to #5204

@github-actions github-actions bot added the C Related code is in C label Feb 25, 2025
@nilason nilason added this to the 8.5.0 milestone Feb 25, 2025
@nilason nilason merged commit a61a6f6 into OSGeo:main Feb 26, 2025
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C Related code is in C
Projects
Development

Successfully merging this pull request may close these issues.

2 participants