[PATCH 4/4] kern_ntptime: sys_ntp_adjtime() does not return error when modes is 0 or MOD_TAI

Moyano, Gabriel gabriel.moyano at dlr.de
Thu Feb 3 15:19:23 UTC 2022


---
 freebsd/sys/kern/kern_ntptime.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/freebsd/sys/kern/kern_ntptime.c b/freebsd/sys/kern/kern_ntptime.c
index f9465ea0..3a102b13 100644
--- a/freebsd/sys/kern/kern_ntptime.c
+++ b/freebsd/sys/kern/kern_ntptime.c
@@ -489,12 +489,14 @@ sys_ntp_adjtime(struct thread *td, struct ntp_adjtime_args *uap)
 	NTP_UNLOCK();
 
 	error = copyout((caddr_t)&ntv, (caddr_t)uap->tp, sizeof(ntv));
-	if (error == 0)
+	if (error == 0) {
 #ifdef __rtems__
+    if (modes != 0 && modes != MOD_TAI)
         error = retval;
 #else /* __rtems__ */
 		td->td_retval[0] = retval;
 #endif /* __rtems__ */
+    }
 	return (error);
 }
 
-- 
2.17.1



More information about the devel mailing list