Explorar el Código

LibTimeZone: Read /etc/timezone for current TZ

Fallback to reading /etc/timezone by calling system_time_zone() when
unable determine time zone from /etc/localtime.
This works on systems where /etc/localtime is a file and not a symlink.

Fixes #65
Nathan E. Egge hace 1 año
padre
commit
d83ab035ee
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      Userland/Libraries/LibTimeZone/TimeZone.cpp

+ 2 - 1
Userland/Libraries/LibTimeZone/TimeZone.cpp

@@ -129,7 +129,8 @@ StringView current_time_zone()
         dbgln_if(TIME_ZONE_DEBUG, "Could not read the /etc/localtime link: {}", strerror(errno));
         dbgln_if(TIME_ZONE_DEBUG, "Could not read the /etc/localtime link: {}", strerror(errno));
     }
     }
 
 
-    return "UTC"sv;
+    // Read the system timezone file /etc/timezone
+    return system_time_zone();
 #endif
 #endif
 }
 }