svn commit: trunk/busybox/util-linux

vapier at busybox.net vapier at busybox.net
Wed Sep 28 03:21:23 UTC 2005


Author: vapier
Date: 2005-09-27 20:21:21 -0700 (Tue, 27 Sep 2005)
New Revision: 11677

Log:
allow people to adjtime location

Modified:
   trunk/busybox/util-linux/Config.in
   trunk/busybox/util-linux/hwclock.c


Changeset:
Modified: trunk/busybox/util-linux/Config.in
===================================================================
--- trunk/busybox/util-linux/Config.in	2005-09-28 01:18:01 UTC (rev 11676)
+++ trunk/busybox/util-linux/Config.in	2005-09-28 03:21:21 UTC (rev 11677)
@@ -208,6 +208,18 @@
 	  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

Modified: trunk/busybox/util-linux/hwclock.c
===================================================================
--- trunk/busybox/util-linux/hwclock.c	2005-09-28 01:18:01 UTC (rev 11676)
+++ trunk/busybox/util-linux/hwclock.c	2005-09-28 03:21:21 UTC (rev 11677)
@@ -155,11 +155,15 @@
 	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];




More information about the busybox-cvs mailing list