diff options
author | Mike Frysinger <vapier@gentoo.org> | 2005-09-28 03:21:21 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2005-09-28 03:21:21 +0000 |
commit | 747fc5d5fda30e7d4314d8abe80029f3792602d6 (patch) | |
tree | ecfb293f5feba4bcdb9a703b202ab7269ad69c8e | |
parent | 3978e5576e1675c2fac631fcba07a976405b5e4b (diff) |
allow people to adjtime location
-rw-r--r-- | util-linux/Config.in | 12 | ||||
-rw-r--r-- | util-linux/hwclock.c | 8 |
2 files changed, 18 insertions, 2 deletions
diff --git a/util-linux/Config.in b/util-linux/Config.in index 2cd578332..01da99c41 100644 --- a/util-linux/Config.in +++ b/util-linux/Config.in @@ -208,6 +208,18 @@ config CONFIG_FEATURE_HWCLOCK_LONGOPTIONS are overly fond of its long options, such as --hctosys, --utc, etc) then enable this option. +config CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS + bool " Use FHS /var/lib/hwclock/adjtime" + default y + depends on CONFIG_HWCLOCK + help + Starting with FHS 2.3, the adjtime state file is supposed to exist + at /var/lib/hwclock/adjtime instead of /etc/adjtime. If you wish + to use the FHS behavior, answer Y here, otherwise answer N for the + classic /etc/adjtime path. + + http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLIBHWCLOCKSTATEDIRECTORYFORHWCLO + config CONFIG_IPCRM bool "ipcrm" default n diff --git a/util-linux/hwclock.c b/util-linux/hwclock.c index 11261f47d..45959e7a1 100644 --- a/util-linux/hwclock.c +++ b/util-linux/hwclock.c @@ -155,11 +155,15 @@ static int from_sys_clock(int utc) return 0; } - +#ifdef CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS +# define ADJTIME_PATH "/var/lib/hwclock/adjtime" +#else +# define ADJTIME_PATH "/etc/adjtime" +#endif static int check_utc(void) { int utc = 0; - FILE *f = fopen ( "/var/lib/hwclock/adjtime", "r" ); + FILE *f = fopen ( ADJTIME_PATH, "r" ); if ( f ) { char buffer [128]; |