diff options
author | Robert Watson <rwatson@FreeBSD.org> | 2007-06-14 18:37:58 +0000 |
---|---|---|
committer | Robert Watson <rwatson@FreeBSD.org> | 2007-06-14 18:37:58 +0000 |
commit | b4be6ef22fdb72abe1a4d84721a69582a0ccbfed (patch) | |
tree | 4db8624dcaa8cff59df39a75e90774301ac6303e /sys/kern | |
parent | a2346f7c3cd3ee540893b8c53f528aa875379506 (diff) | |
download | src-b4be6ef22fdb72abe1a4d84721a69582a0ccbfed.tar.gz src-b4be6ef22fdb72abe1a4d84721a69582a0ccbfed.zip |
Notes
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_ntptime.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/kern/kern_ntptime.c b/sys/kern/kern_ntptime.c index b1148235fe69..30cb4b1ca701 100644 --- a/sys/kern/kern_ntptime.c +++ b/sys/kern/kern_ntptime.c @@ -950,9 +950,6 @@ kern_adjtime(struct thread *td, struct timeval *delta, struct timeval *olddelta) struct timeval atv; int error; - if ((error = priv_check(td, PRIV_ADJTIME))) - return (error); - mtx_lock(&Giant); if (olddelta) { atv.tv_sec = time_adjtime / 1000000; @@ -963,10 +960,15 @@ kern_adjtime(struct thread *td, struct timeval *delta, struct timeval *olddelta) } *olddelta = atv; } - if (delta) + if (delta) { + if ((error = priv_check(td, PRIV_ADJTIME))) { + mtx_unlock(&Giant); + return (error); + } time_adjtime = (int64_t)delta->tv_sec * 1000000 + delta->tv_usec; + } mtx_unlock(&Giant); - return (error); + return (0); } |