-static void verify_timezone(void) {
- char *p, *a = NULL, *b = NULL;
- size_t l, q;
- int j, k;
-
- if (!tz.zone)
- return;
-
- p = strappend("/usr/share/zoneinfo/", tz.zone);
- if (!p) {
- log_error("Out of memory");
- return;
- }
-
- j = read_full_file("/etc/localtime", &a, &l);
- k = read_full_file(p, &b, &q);
-
- free(p);
-
- if (j < 0 || k < 0 || l != q || memcmp(a, b, l)) {
- log_warning("/etc/localtime and /etc/timezone out of sync.");
- free(tz.zone);
- tz.zone = NULL;
- }
-
- free(a);
- free(b);
-}
-