From: Oliver Kurth Date: Fri, 6 Jul 2018 21:31:55 +0000 (-0700) Subject: Common source file change, not directly applicable to open-vm-tools. X-Git-Tag: stable-10.3.0~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a30d7aaa4d10fbce4b7d262487fffaf1dc32d949;p=thirdparty%2Fopen-vm-tools.git Common source file change, not directly applicable to open-vm-tools. Enforce monotonic behavior for the value returned by times() on Mac. --- diff --git a/open-vm-tools/lib/system/systemLinux.c b/open-vm-tools/lib/system/systemLinux.c index 5b067bef1..c74d48901 100644 --- a/open-vm-tools/lib/system/systemLinux.c +++ b/open-vm-tools/lib/system/systemLinux.c @@ -162,11 +162,13 @@ System_GetTimeMonotonic(void) return base + (last = current); #else // VM_X86_64 -#ifdef sun - /* Solaris has a bug where times() can return a lower value than in - * a previous call, see bug #1710952, so we make sure to never - * return a lower value, by saving the old value and compare. - * We also make that thread safe. */ +#if defined sun || defined __APPLE__ + /* + * PR 1710952 and PR 2136820 + * times() on Solaris & Mac can return a lower value than the + * one in a previous call. As a workaround, we return the last + * cached value when we get a lower value from times(). + */ static Atomic_uint64 last = { 0 }; while (1) {