diff options
-rw-r--r-- | src/libfaketime.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/libfaketime.c b/src/libfaketime.c index 34644bc..e632395 100644 --- a/src/libfaketime.c +++ b/src/libfaketime.c @@ -34,8 +34,10 @@ #include <sys/epoll.h> #endif #ifdef __GLIBC__ +#ifndef __APPLE__ #include <gnu/libc-version.h> #endif +#endif #include <time.h> #ifdef MACOS_DYLD_INTERPOSE #include <sys/time.h> @@ -3582,10 +3584,10 @@ bool needs_forced_monotonic_fix(char *function_name) * environment variable to 1, or disabled by setting it to 0 */ if ((env_var = getenv("FAKETIME_FORCE_MONOTONIC_FIX")) != NULL) { - if (env_var[0] == '0') - result = false; - else - result = true; + if (env_var[0] == '0') + result = false; + else + result = true; } else { @@ -3600,7 +3602,7 @@ bool needs_forced_monotonic_fix(char *function_name) * with pthread_cond_timedwait(). The used boundaries may still be * imprecise. */ if ( (glibc_major == 2) && - ((glibc_minor <= 17) || (glibc_minor >= 30)) ) + ((glibc_minor <= 24) || (glibc_minor >= 30)) ) { result = true; } @@ -3611,7 +3613,7 @@ bool needs_forced_monotonic_fix(char *function_name) if (getenv("FAKETIME_DEBUG") != NULL) #ifdef __GLIBC__ - fprintf(stderr, "libfaketime: forced monotonic fix for %s = %s (glibc version %s)\n", + fprintf(stderr, "libfaketime: forced monotonic fix for %s = %s (glibc version %s)\n", function_name, result ? "yes":"no", glibc_version_string); #else fprintf(stderr, "libfaketime: forced monotonic fix for %s = %s (not glibc-compiled)\n", |