]>
Commit | Line | Data |
---|---|---|
827e094d MB |
1 | Index: applets/clock/system-timezone.c |
2 | =================================================================== | |
3 | --- applets/clock/system-timezone.c (revision 11072) | |
4 | +++ applets/clock/system-timezone.c (working copy) | |
5 | @@ -67,23 +67,25 @@ | |
6 | #include "system-timezone.h" | |
7 | ||
8 | /* Files that we look at and that should be monitored */ | |
9 | -#define CHECK_NB 5 | |
10 | +#define CHECK_NB 6 | |
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" | |
25 | #else | |
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 */ | |
43 | ||
44 | /* The first 4 characters in a timezone file, from tzfile.h */ | |
45 | @@ -93,6 +95,7 @@ | |
46 | ETC_TIMEZONE, | |
47 | ETC_TIMEZONE_MAJ, | |
48 | ETC_SYSCONFIG_CLOCK, | |
49 | + ETC_SYSCONFIG_TIMEZONE, | |
50 | ETC_CONF_D_CLOCK, | |
51 | ETC_LOCALTIME | |
52 | }; | |
53 | @@ -312,6 +315,7 @@ | |
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 | |
59 | * | |
60 | * FIXME: reading the system-tools-backends, it seems there's this too: | |
61 | @@ -554,6 +558,22 @@ | |
62 | "ZONE", tz, error); | |
63 | } | |
64 | ||
65 | +/* This works for PLD Linux */ | |
66 | +static char * | |
67 | +system_timezone_read_etc_sysconfig_timezone (void) | |
68 | +{ | |
69 | + return system_timezone_read_key_file (ETC_SYSCONFIG_TIMEZONE, | |
70 | + "TIMEZONE"); | |
71 | +} | |
72 | + | |
73 | +static gboolean | |
74 | +system_timezone_write_etc_sysconfig_timezone (const char *tz, | |
75 | + GError **error) | |
76 | +{ | |
77 | + return system_timezone_write_key_file (ETC_SYSCONFIG_TIMEZONE, | |
78 | + "TIMEZONE", tz, error); | |
79 | +} | |
80 | + | |
81 | /* This works for openSUSE */ | |
82 | static char * | |
83 | system_timezone_read_etc_sysconfig_clock_alt (void) | |
84 | @@ -812,6 +832,7 @@ | |
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 | |
92 | @@ -983,6 +1004,7 @@ | |
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, |