mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
Userland: Invoke tzset in applications that care about time zones
In most applications, we invoke tzset once at startup for now. Most of these are short lived and don't need to know about time zone changes. The exception is the ClockWidget in the taskbar. Here, we invoke tzset each time we update the system time. This way, any time zone changes can take effect immediately.
This commit is contained in:
committed by
Linus Groh
parent
010ec36d20
commit
ede5c9548e
@@ -25,6 +25,8 @@ ErrorOr<int> serenity_main(Main::Arguments)
|
||||
TRY(Core::System::unveil("/proc", "r"));
|
||||
TRY(Core::System::unveil(nullptr, nullptr));
|
||||
|
||||
tzset();
|
||||
|
||||
auto file = TRY(Core::File::open("/var/run/utmp", Core::OpenMode::ReadOnly));
|
||||
auto json = TRY(JsonValue::from_string(file->read_all()));
|
||||
if (!json.is_object()) {
|
||||
|
||||
Reference in New Issue
Block a user