aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--util-linux/Config.in12
-rw-r--r--util-linux/hwclock.c8
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
211config 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
211config CONFIG_IPCRM 223config 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
159static int check_utc(void) 163static 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];