diff options
author | Timothy Flynn <trflynn89@pm.me> | 2022-01-24 16:12:19 -0500 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-01-25 18:39:36 +0000 |
commit | ede5c9548e55d8216dba21ed431b9e53d085a248 (patch) | |
tree | 41a8a8652978d9744dc0a99347eaacd1d054a00a /Userland/Utilities/w.cpp | |
parent | 010ec36d20e6c2d97fd6fb4e6bd7f8582f123c57 (diff) | |
download | serenity-ede5c9548e55d8216dba21ed431b9e53d085a248.zip |
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.
Diffstat (limited to 'Userland/Utilities/w.cpp')
-rw-r--r-- | Userland/Utilities/w.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Userland/Utilities/w.cpp b/Userland/Utilities/w.cpp index 2d4ed240f1..f59d7fc888 100644 --- a/Userland/Utilities/w.cpp +++ b/Userland/Utilities/w.cpp @@ -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()) { |