allow people to adjtime location
authorMike Frysinger <vapier@gentoo.org>
Wed, 28 Sep 2005 03:21:21 +0000 (03:21 -0000)
committerMike Frysinger <vapier@gentoo.org>
Wed, 28 Sep 2005 03:21:21 +0000 (03:21 -0000)
util-linux/Config.in
util-linux/hwclock.c

index 2cd57833241592557adba90924dd5221e6e1a0d0..01da99c41981cbc33b873d4049ee1c173d59851a 100644 (file)
@@ -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
index 11261f47db889a9b3c55962ee0c2172975e1e20b..45959e7a19a4f9f3d40f4ca52c409fe9e6e305dc 100644 (file)
@@ -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];