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) | |
download | busybox-w32-747fc5d5fda30e7d4314d8abe80029f3792602d6.tar.gz busybox-w32-747fc5d5fda30e7d4314d8abe80029f3792602d6.tar.bz2 busybox-w32-747fc5d5fda30e7d4314d8abe80029f3792602d6.zip |
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 | |||
208 | are overly fond of its long options, such as --hctosys, --utc, etc) | 208 | are overly fond of its long options, such as --hctosys, --utc, etc) |
209 | then enable this option. | 209 | then enable this option. |
210 | 210 | ||
211 | config CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS | ||
212 | bool " Use FHS /var/lib/hwclock/adjtime" | ||
213 | default y | ||
214 | depends on CONFIG_HWCLOCK | ||
215 | help | ||
216 | Starting with FHS 2.3, the adjtime state file is supposed to exist | ||
217 | at /var/lib/hwclock/adjtime instead of /etc/adjtime. If you wish | ||
218 | to use the FHS behavior, answer Y here, otherwise answer N for the | ||
219 | classic /etc/adjtime path. | ||
220 | |||
221 | http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLIBHWCLOCKSTATEDIRECTORYFORHWCLO | ||
222 | |||
211 | config CONFIG_IPCRM | 223 | config CONFIG_IPCRM |
212 | bool "ipcrm" | 224 | bool "ipcrm" |
213 | default n | 225 | 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) | |||
155 | return 0; | 155 | return 0; |
156 | } | 156 | } |
157 | 157 | ||
158 | 158 | #ifdef CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS | |
159 | # define ADJTIME_PATH "/var/lib/hwclock/adjtime" | ||
160 | #else | ||
161 | # define ADJTIME_PATH "/etc/adjtime" | ||
162 | #endif | ||
159 | static int check_utc(void) | 163 | static int check_utc(void) |
160 | { | 164 | { |
161 | int utc = 0; | 165 | int utc = 0; |
162 | FILE *f = fopen ( "/var/lib/hwclock/adjtime", "r" ); | 166 | FILE *f = fopen ( ADJTIME_PATH, "r" ); |
163 | 167 | ||
164 | if ( f ) { | 168 | if ( f ) { |
165 | char buffer [128]; | 169 | char buffer [128]; |