From: Miroslav Lichvar Date: Fri, 18 Sep 2015 08:16:40 +0000 (+0200) Subject: sys_timex: set timex constant on Solaris X-Git-Tag: 2.2-pre1~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1d2b481069f1814e636d7e5d2963025ed60e5df1;p=thirdparty%2Fchrony.git sys_timex: set timex constant on Solaris The kernel apparently checks the constant even when it's not being set with MOD_TIMECONST and may return EINVAL on an uninitialized value. --- diff --git a/sys_timex.c b/sys_timex.c index 05afc92f..b2b53994 100644 --- a/sys_timex.c +++ b/sys_timex.c @@ -215,6 +215,12 @@ SYS_Timex_Adjust(struct timex *txc, int ignore_error) { int state; +#ifdef SOLARIS + /* The kernel seems to check the constant even when it's not being set */ + if (!(txc->modes & MOD_TIMECONST)) + txc->constant = 10; +#endif + state = NTP_ADJTIME(txc); if (state < 0) {