systemd/drop-timezone.patch

49 lines
1.6 KiB
Diff
Raw Normal View History

Index: systemd-44/src/timedate/timedated.c
===================================================================
--- systemd-44.orig/src/timedate/timedated.c
+++ systemd-44/src/timedate/timedated.c
@@ -203,24 +203,18 @@ static int read_data(void) {
free(t);
- r = read_one_line_file("/etc/timezone", &tz.zone);
- if (r < 0) {
- if (r != -ENOENT)
- log_warning("Failed to read /etc/timezone: %s", strerror(-r));
-
#if defined(TARGET_FEDORA) || defined(TARGET_SUSE)
- r = parse_env_file("/etc/sysconfig/clock", NEWLINE,
+ r = parse_env_file("/etc/sysconfig/clock", NEWLINE,
#ifdef TARGET_FEDORA
- "ZONE", &tz.zone,
+ "ZONE", &tz.zone,
#else /* TARGET_SUSE */
- "TIMEZONE", &tz.zone,
+ "TIMEZONE", &tz.zone,
#endif
- NULL);
+ NULL);
- if (r < 0 && r != -ENOENT)
- log_warning("Failed to read /etc/sysconfig/clock: %s", strerror(-r));
+ if (r < 0 && r != -ENOENT)
+ log_warning("Failed to read /etc/sysconfig/clock: %s", strerror(-r));
#endif
- }
have_timezone:
if (isempty(tz.zone)) {
@@ -263,12 +257,6 @@ static int write_data_timezone(void) {
if (r < 0)
return -errno;
- if (stat("/etc/timezone", &st) == 0 && S_ISREG(st.st_mode)) {
- r = write_one_line_file_atomic("/etc/timezone", tz.zone);
- if (r < 0)
- return r;
- }
-
return 0;
}