Introduce utc_offset() to capture a calculation currently done all over the

place.
This commit is contained in:
Poul-Henning Kamp 2006-10-02 16:17:23 +00:00
parent 8e52f5465d
commit f97c1c4bf7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=162962
2 changed files with 9 additions and 0 deletions

View File

@ -197,3 +197,10 @@ clock_ts_to_ct(struct timespec *ts, struct clocktime *ct)
ct->sec = rsec;
ct->nsec = ts->tv_nsec;
}
int
utc_offset(void)
{
return (tz_minuteswest * 60 + (wall_cmos_clock ? adjkerntz : 0));
}

View File

@ -59,6 +59,8 @@ extern int disable_rtc_set;
extern int tz_minuteswest;
extern int tz_dsttime;
int utc_offset(void);
/*
* Structure to hold the values typically reported by time-of-day clocks.
* This can be passed to the generic conversion functions to be converted