1 Index: applets/clock/system-timezone.c
2 ===================================================================
3 --- applets/clock/system-timezone.c (revision 11072)
4 +++ applets/clock/system-timezone.c (working copy)
6 #include "system-timezone.h"
8 /* Files that we look at and that should be monitored */
11 #ifndef SYSTZ_SET_TEST
12 -#define ETC_TIMEZONE "/etc/timezone"
13 -#define ETC_TIMEZONE_MAJ "/etc/TIMEZONE"
14 -#define ETC_RC_CONF "/etc/rc.conf"
15 -#define ETC_SYSCONFIG_CLOCK "/etc/sysconfig/clock"
16 -#define ETC_CONF_D_CLOCK "/etc/conf.d/clock"
17 -#define ETC_LOCALTIME "/etc/localtime"
18 +#define ETC_TIMEZONE "/etc/timezone"
19 +#define ETC_TIMEZONE_MAJ "/etc/TIMEZONE"
20 +#define ETC_RC_CONF "/etc/rc.conf"
21 +#define ETC_SYSCONFIG_CLOCK "/etc/sysconfig/clock"
22 +#define ETC_SYSCONFIG_TIMEZONE "/etc/sysconfig/timezone"
23 +#define ETC_CONF_D_CLOCK "/etc/conf.d/clock"
24 +#define ETC_LOCALTIME "/etc/localtime"
26 /* Filenames that will be writable for testing */
27 -#define TEST_PREFIX "/tmp/systz-test"
28 -#define ETC_TIMEZONE TEST_PREFIX"/etc/timezone"
29 -#define ETC_TIMEZONE_MAJ TEST_PREFIX"/etc/TIMEZONE"
30 -#define ETC_RC_CONF TEST_PREFIX"/etc/rc.conf"
31 -#define ETC_SYSCONFIG_CLOCK TEST_PREFIX"/etc/sysconfig/clock"
32 -#define ETC_CONF_D_CLOCK TEST_PREFIX"/etc/conf.d/clock"
33 -#define ETC_LOCALTIME TEST_PREFIX"/etc/localtime"
34 +#define TEST_PREFIX "/tmp/systz-test"
35 +#define ETC_TIMEZONE TEST_PREFIX"/etc/timezone"
36 +#define ETC_TIMEZONE_MAJ TEST_PREFIX"/etc/TIMEZONE"
37 +#define ETC_RC_CONF TEST_PREFIX"/etc/rc.conf"
38 +#define ETC_SYSCONFIG_CLOCK TEST_PREFIX"/etc/sysconfig/clock"
39 +#define ETC_SYSCONFIG_TIMEZONE TEST_PREFIX"/etc/sysconfig/timezone"
40 +#define ETC_CONF_D_CLOCK TEST_PREFIX"/etc/conf.d/clock"
41 +#define ETC_LOCALTIME TEST_PREFIX"/etc/localtime"
42 #endif /* SYSTZ_SET_TEST */
44 /* The first 4 characters in a timezone file, from tzfile.h */
49 + ETC_SYSCONFIG_TIMEZONE,
54 * openSUSE: the TIMEZONE key in /etc/sysconfig/clock
55 * Solaris/OpenSolaris: the TZ key in /etc/TIMEZONE
56 * Arch Linux: the TIMEZONE key in /etc/rc.conf
57 + * PLD Linux: the TIMEZONE key in /etc/sysconfig/timezone
58 * Gentoo (old): the ZONE key in /etc/conf.d/clock
60 * FIXME: reading the system-tools-backends, it seems there's this too:
65 +/* This works for PLD Linux */
67 +system_timezone_read_etc_sysconfig_timezone (void)
69 + return system_timezone_read_key_file (ETC_SYSCONFIG_TIMEZONE,
74 +system_timezone_write_etc_sysconfig_timezone (const char *tz,
77 + return system_timezone_write_key_file (ETC_SYSCONFIG_TIMEZONE,
78 + "TIMEZONE", tz, error);
81 /* This works for openSUSE */
83 system_timezone_read_etc_sysconfig_clock_alt (void)
85 system_timezone_read_etc_sysconfig_clock_alt,
86 system_timezone_read_etc_TIMEZONE,
87 system_timezone_read_etc_rc_conf,
88 + system_timezone_read_etc_sysconfig_timezone,
89 /* reading deprecated config files */
90 system_timezone_read_etc_conf_d_clock,
91 /* reading /etc/timezone directly. Expensive since we have to stat
93 system_timezone_write_etc_sysconfig_clock_alt,
94 system_timezone_write_etc_TIMEZONE,
95 system_timezone_write_etc_rc_conf,
96 + system_timezone_write_etc_sysconfig_timezone,
97 /* writing deprecated config files if they exist and have the
98 * setting already present */
99 system_timezone_write_etc_conf_d_clock,