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

tmr: fix FreeBSD CLOCK_MONOTONIC #97

Merged
merged 3 commits into from
Apr 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/tmr/tmr.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Copyright (C) 2010 Creytiv.com
*/
#ifdef DARWIN
#if defined(FREEBSD) || defined(OPENBSD) || defined(DARWIN)
#define _DEFAULT_SOURCE 1
#else
#define _POSIX_C_SOURCE 199309L
Expand Down Expand Up @@ -142,7 +142,11 @@ uint64_t tmr_jiffies_usec(void)
#else
struct timespec now;

#if defined(FREEBSD) || defined(OPENBSD)
if (0 != clock_gettime(CLOCK_MONOTONIC, &now)) {
#else
if (0 != clock_gettime(CLOCK_MONOTONIC_RAW, &now)) {
#endif
DEBUG_WARNING("jiffies: clock_gettime() failed (%m)\n", errno);
return 0;
}
Expand Down