As hwclock updates this file when running, it should be in /var/lib as suggested by FHS. Signed-off-by: Matthias Koenig <mkoenig@xxxxxxx> --- hwclock/clock-ppc.c | 17 +++++++++-------- hwclock/hwclock.8 | 6 +++--- hwclock/hwclock.c | 31 ++++++++++++++++--------------- 3 files changed, 28 insertions(+), 26 deletions(-) diff --git a/hwclock/clock-ppc.c b/hwclock/clock-ppc.c index b73d0ad..34ffb21 100644 --- a/hwclock/clock-ppc.c +++ b/hwclock/clock-ppc.c @@ -62,9 +62,9 @@ Web Page: http://www.protein.osaka-u.ac.jp/chemistry/matsuura/ * reading '/etc/clock -au' instead of '/etc/clock -u -s', this error * is automatically corrected at every boot. * - * To do this job, the program reads and writes the file '/etc/adjtime' - * to determine the correction, and to save its data. In this file are - * three numbers: + * To do this job, the program reads and writes the file + * '/var/lib/hwclock/adjtime' to determine the correction, and to save its + * data. In this file are three numbers: * * 1) the correction in seconds per day (So if your clock runs 5 * seconds per day fast, the first number should read -5.0) @@ -75,13 +75,14 @@ Web Page: http://www.protein.osaka-u.ac.jp/chemistry/matsuura/ * * Installation and use of this program: * - * a) create a file '/etc/adjtime' containing as the first and only line: + * a) create a file '/var/lib/hwclock/adjtime' containing as the first and + * only line: * '0.0 0 0.0' * b) run 'clock -au' or 'clock -a', depending on whether your cmos is in * universal or local time. This updates the second number. * c) set your system time using the 'date' command. * d) update your cmos time using 'clock -wu' or 'clock -w' - * e) replace the first number in /etc/adjtime by your correction. + * e) replace the first number in /var/lib/hwclock/adjtime by your correction. * f) put the command 'clock -au' or 'clock -a' in your '/etc/rc.local' * * If the adjustment doesn't work for you, try contacting me by E-mail. @@ -114,8 +115,8 @@ Web Page: http://www.protein.osaka-u.ac.jp/chemistry/matsuura/ * clock -u a cron job. The kernel adjusts cmos time every 11 * minutes - see kernel/sched.c and kernel/time.c set_rtc_mmss(). * This means we should really have a cron job updating - * /etc/adjtime every 11 mins (set last_time to the current time - * and not_adjusted to ???). + * /var/lib/hwclock/adjtime every 11 mins (set last_time to the + * current time and not_adjusted to ???). * b) Swapped arguments of outb() to agree with asm/io.h macro of the * same name. Use outb() from asm/io.h as it's slightly better. * c) Changed CMOS_READ and CMOS_WRITE to inline functions. Inserted @@ -144,7 +145,7 @@ Web Page: http://www.protein.osaka-u.ac.jp/chemistry/matsuura/ #define VERSION "1.4" /* Here the information for time adjustments is kept. */ -#define ADJPATH "/etc/adjtime" +#define ADJPATH "/var/lib/hwclock/adjtime" /* Apparently the RTC on PowerMacs stores seconds since 1 Jan 1904 */ #define RTC_OFFSET 2082844800 diff --git a/hwclock/hwclock.8 b/hwclock/hwclock.8 index 47a56f7..754ec94 100644 --- a/hwclock/hwclock.8 +++ b/hwclock/hwclock.8 @@ -174,7 +174,7 @@ exist, the default is local time. .TP .B \-\-noadjfile disables the facilities provided by -.IR /etc/adjtime . +.IR /var/lib/hwclock/adjtime . .B hwclock will not read nor write to that file with this option. Either .B \-\-utc @@ -457,7 +457,7 @@ systematic drift. It works like this: .B hwclock keeps a file, -.I /etc/adjtime, +.I /var/lib/hwclock/adjtime, that keeps some historical information. This is called the adjtime file. .PP Suppose you start with no adjtime file. You issue a @@ -600,7 +600,7 @@ are supported by the hardware. .I TZ .SH FILES -.I /etc/adjtime +.I /var/lib/hwclock/adjtime .I /usr/share/zoneinfo/ .RI ( /usr/lib/zoneinfo on old systems) diff --git a/hwclock/hwclock.c b/hwclock/hwclock.c index f138a9f..206a867 100644 --- a/hwclock/hwclock.c +++ b/hwclock/hwclock.c @@ -45,9 +45,9 @@ * reading '/etc/clock -au' instead of '/etc/clock -u -s', this error * is automatically corrected at every boot. * - * To do this job, the program reads and writes the file '/etc/adjtime' - * to determine the correction, and to save its data. In this file are - * three numbers: + * To do this job, the program reads and writes the file + * '/var/lib/hwclock/adjtime' to determine the correction, and to save its + * data. In this file are three numbers: * * 1) the correction in seconds per day. (So if your clock runs 5 * seconds per day fast, the first number should read -5.0) @@ -58,13 +58,14 @@ * * Installation and use of this program: * - * a) create a file '/etc/adjtime' containing as the first and only line: + * a) create a file '/var/lib/hwclock/adjtime' containing as the first and + * only line: * '0.0 0 0.0' * b) run 'clock -au' or 'clock -a', depending on whether your cmos is in * universal or local time. This updates the second number. * c) set your system time using the 'date' command. * d) update your cmos time using 'clock -wu' or 'clock -w' - * e) replace the first number in /etc/adjtime by your correction. + * e) replace the first number in /var/lib/hwclock/adjtime by your correction. * f) put the command 'clock -au' or 'clock -a' in your '/etc/rc.local' */ @@ -101,7 +102,7 @@ struct clock_ops *ur; #define FLOOR(arg) ((arg >= 0 ? (int) arg : ((int) arg) - 1)); /* Here the information for time adjustments is kept. */ -#define ADJPATH "/etc/adjtime" +#define ADJPATH "/var/lib/hwclock/adjtime" /* Store the date here when "badyear" flag is set. */ #define LASTDATE "/var/lib/lastdate" @@ -236,10 +237,10 @@ hw_clock_is_utc(const bool utc, const bool local_opt, static int read_adjtime(struct adjtime *adjtime_p) { /*---------------------------------------------------------------------------- - Read the adjustment parameters out of the /etc/adjtime file. + Read the adjustment parameters out of the /var/lib/hwclock/adjtime file. Return them as the adjtime structure <*adjtime_p>. - If there is no /etc/adjtime file, return defaults. + If there is no /var/lib/hwclock/adjtime file, return defaults. If values are missing from the file, return defaults for them. return value 0 if all OK, !=0 otherwise. @@ -775,10 +776,10 @@ adjust_drift_factor(struct adjtime *adjtime_p, } else if (adjtime_p->last_calib_time != 0) { /* * At adjustment time we adjust the hardware clock according - * to the contents of /etc/adjtime. + * to the contents of /var/lib/hwclock/adjtime. * * At calibration time we set the hardware clock and - * update /etc/adjtime, that is, for each calibration + * update /var/lib/hwclock/adjtime, that is, for each calibration * (except the first) we also do an adjustment. * * We are now at calibration time. @@ -1228,7 +1229,7 @@ usage( const char *fmt, ... ) { " --date specifies the time to which to set the hardware clock\n" " --epoch=year specifies the year which is the beginning of the \n" " hardware clock's epoch value\n" - " --noadjfile do not access /etc/adjtime. Requires the use of\n" + " --noadjfile do not access /var/lib/hwclock/adjtime. Requires the use of\n" " either --utc or --localtime\n" ),RTC_DEV); #ifdef __alpha__ @@ -1286,7 +1287,7 @@ static const struct option longopts[] = { * Returns: * EX_USAGE: bad invocation * EX_NOPERM: no permission - * EX_OSFILE: cannot open /dev/rtc or /etc/adjtime + * EX_OSFILE: cannot open /dev/rtc or /var/lib/hwclock/adjtime * EX_IOERR: ioctl error getting or setting the time * 0: OK (or not) * 1: failure @@ -1326,7 +1327,7 @@ main(int argc, char **argv) { setlocale(LC_ALL, ""); #ifdef LC_NUMERIC /* We need LC_CTYPE and LC_TIME and LC_MESSAGES, but must avoid - LC_NUMERIC since it gives problems when we write to /etc/adjtime. + LC_NUMERIC since it gives problems when we write to /var/lib/hwclock/adjtime. - gqueri@xxxxxxxxxxxxxx */ setlocale(LC_NUMERIC, "C"); #endif @@ -1627,8 +1628,8 @@ hwaudit_exit(int status) 2) Running the "date" program to interpret the value of our --date option. - Reading the /etc/adjtime file is the next biggest source of delay and - uncertainty. + Reading the /var/lib/hwclock/adjtime file is the next biggest source of + delay and uncertainty. The user wants to know what time it was at the moment he invoked us, not some arbitrary time later. And in setting the clock, he is -- To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html