Reduce the resettodr_lock scope to only CLOCK_SETTIME() call.
Tested by: pho (as part of the whole patch) Reviewed by: jhb (same) Discussed with: bde Sponsored by: The FreeBSD Foundation MFC after: 1 month X-Differential revision: https://reviews.freebsd.org/D7302
This commit is contained in:
parent
4d29106e55
commit
21547fc7ca
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=303385
@ -172,11 +172,11 @@ resettodr(void)
|
||||
if (disable_rtc_set || clock_dev == NULL)
|
||||
return;
|
||||
|
||||
mtx_lock(&resettodr_lock);
|
||||
getnanotime(&ts);
|
||||
timespecadd(&ts, &clock_adj);
|
||||
ts.tv_sec -= utc_offset();
|
||||
/* XXX: We should really set all registered RTCs */
|
||||
mtx_lock(&resettodr_lock);
|
||||
error = CLOCK_SETTIME(clock_dev, &ts);
|
||||
mtx_unlock(&resettodr_lock);
|
||||
if (error != 0)
|
||||
|
Loading…
Reference in New Issue
Block a user