From 1d2b481069f1814e636d7e5d2963025ed60e5df1 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Fri, 18 Sep 2015 10:16:40 +0200 Subject: [PATCH] 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. --- sys_timex.c | 6 ++++++ 1 file changed, 6 insertions(+) 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) { -- 2.47.2