allow people to adjtime location
This commit is contained in:
parent
3978e5576e
commit
747fc5d5fd
@ -208,6 +208,18 @@ config CONFIG_FEATURE_HWCLOCK_LONGOPTIONS
|
|||||||
are overly fond of its long options, such as --hctosys, --utc, etc)
|
are overly fond of its long options, such as --hctosys, --utc, etc)
|
||||||
then enable this option.
|
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
|
config CONFIG_IPCRM
|
||||||
bool "ipcrm"
|
bool "ipcrm"
|
||||||
default n
|
default n
|
||||||
|
@ -155,11 +155,15 @@ static int from_sys_clock(int utc)
|
|||||||
return 0;
|
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)
|
static int check_utc(void)
|
||||||
{
|
{
|
||||||
int utc = 0;
|
int utc = 0;
|
||||||
FILE *f = fopen ( "/var/lib/hwclock/adjtime", "r" );
|
FILE *f = fopen ( ADJTIME_PATH, "r" );
|
||||||
|
|
||||||
if ( f ) {
|
if ( f ) {
|
||||||
char buffer [128];
|
char buffer [128];
|
||||||
|
Loading…
Reference in New Issue
Block a user