/*********************************************************
- * Copyright (C) 2008-2016 VMware, Inc. All rights reserved.
+ * Copyright (C) 2008-2017 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
# define G_INLINE_FUNC static __inline
#endif
+#ifndef ABS
+# define ABS(x) (((x) >= 0) ? (x) : -(x))
+#endif
+
/**
* Converts an UTF-8 path to the local (i.e., glib) file name encoding.
/*********************************************************
- * Copyright (C) 2008-2016 VMware, Inc. All rights reserved.
+ * Copyright (C) 2008-2017 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
return FALSE;
}
- if (adjustment > TIMESYNC_PLL_UNSYNC &&
+ if (ABS(adjustment) > TIMESYNC_PLL_UNSYNC &&
data->slewState != TimeSyncUncalibrated) {
g_debug("Adjustment too large (%"FMT64"d), resetting PLL state.\n",
adjustment);
data->slewState = TimeSyncUncalibrated;
return FALSE;
}
- if (adjustment < TIMESYNC_PLL_ACTIVATE && TimeSync_PLLSupported()) {
+ if (ABS(adjustment) < TIMESYNC_PLL_ACTIVATE && TimeSync_PLLSupported()) {
g_debug("Starting PLL calibration.\n");
calibrationStart = now;
/* Starting out the calibration period we are adjustment behind,