From 8599ee30490b8fe96c0972eff7ad621cd1a770dd Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Fri, 28 Jan 2022 07:38:10 -0500 Subject: [PATCH] Revert "Userland: Invoke tzset in apps that care about time zones" This reverts most of commit ede5c9548e55d8216dba21ed431b9e53d085a248. The one change not reverted is ClockWidget.h, so that the taskbar clock can continue to notice time zone changes. --- Userland/Applications/AnalogClock/main.cpp | 3 --- Userland/Applications/Browser/main.cpp | 3 --- Userland/Applications/Calendar/main.cpp | 3 --- Userland/Services/RequestServer/main.cpp | 3 --- Userland/Services/WebContent/main.cpp | 3 --- Userland/Utilities/date.cpp | 2 -- Userland/Utilities/ddate.cpp | 3 --- Userland/Utilities/fortune.cpp | 3 --- Userland/Utilities/js.cpp | 3 --- Userland/Utilities/w.cpp | 2 -- 10 files changed, 28 deletions(-) diff --git a/Userland/Applications/AnalogClock/main.cpp b/Userland/Applications/AnalogClock/main.cpp index 426d84a5f6e..719103410e8 100644 --- a/Userland/Applications/AnalogClock/main.cpp +++ b/Userland/Applications/AnalogClock/main.cpp @@ -14,7 +14,6 @@ #include #include #include -#include ErrorOr serenity_main(Main::Arguments arguments) { @@ -25,8 +24,6 @@ ErrorOr serenity_main(Main::Arguments arguments) TRY(Core::System::unveil("/res", "r")); TRY(Core::System::unveil(nullptr, nullptr)); - tzset(); - auto app_icon = TRY(GUI::Icon::try_create_default_icon("app-analog-clock")); auto window = TRY(GUI::Window::try_create()); window->set_title(Core::DateTime::now().to_string("%Y-%m-%d")); diff --git a/Userland/Applications/Browser/main.cpp b/Userland/Applications/Browser/main.cpp index cbba6d7552f..413bb68059f 100644 --- a/Userland/Applications/Browser/main.cpp +++ b/Userland/Applications/Browser/main.cpp @@ -21,7 +21,6 @@ #include #include #include -#include #include namespace Browser { @@ -83,8 +82,6 @@ ErrorOr serenity_main(Main::Arguments arguments) TRY(Core::System::unveil("/tmp/portal/request", "rw")); TRY(Core::System::unveil(nullptr, nullptr)); - tzset(); - auto app_icon = GUI::Icon::default_icon("app-browser"); Browser::g_home_url = Config::read_string("Browser", "Preferences", "Home", "file:///res/html/misc/welcome.html"); diff --git a/Userland/Applications/Calendar/main.cpp b/Userland/Applications/Calendar/main.cpp index 3270a8ac4f9..57aceb613e6 100644 --- a/Userland/Applications/Calendar/main.cpp +++ b/Userland/Applications/Calendar/main.cpp @@ -19,7 +19,6 @@ #include #include #include -#include ErrorOr serenity_main(Main::Arguments arguments) { @@ -32,8 +31,6 @@ ErrorOr serenity_main(Main::Arguments arguments) TRY(Core::System::unveil("/res", "r")); TRY(Core::System::unveil(nullptr, nullptr)); - tzset(); - auto app_icon = TRY(GUI::Icon::try_create_default_icon("app-calendar")); auto window = TRY(GUI::Window::try_create()); window->set_title("Calendar"); diff --git a/Userland/Services/RequestServer/main.cpp b/Userland/Services/RequestServer/main.cpp index 9972401f5ff..c9b1884b635 100644 --- a/Userland/Services/RequestServer/main.cpp +++ b/Userland/Services/RequestServer/main.cpp @@ -16,7 +16,6 @@ #include #include #include -#include ErrorOr serenity_main(Main::Arguments) { @@ -33,8 +32,6 @@ ErrorOr serenity_main(Main::Arguments) TRY(Core::System::unveil("/etc/timezone", "r")); TRY(Core::System::unveil(nullptr, nullptr)); - tzset(); - [[maybe_unused]] auto gemini = make(); [[maybe_unused]] auto http = make(); [[maybe_unused]] auto https = make(); diff --git a/Userland/Services/WebContent/main.cpp b/Userland/Services/WebContent/main.cpp index 02d04d47867..2c51f2f761a 100644 --- a/Userland/Services/WebContent/main.cpp +++ b/Userland/Services/WebContent/main.cpp @@ -10,7 +10,6 @@ #include #include #include -#include ErrorOr serenity_main(Main::Arguments) { @@ -23,8 +22,6 @@ ErrorOr serenity_main(Main::Arguments) TRY(Core::System::unveil("/tmp/portal/websocket", "rw")); TRY(Core::System::unveil(nullptr, nullptr)); - tzset(); - auto client = TRY(IPC::take_over_accepted_client_from_system_server()); return event_loop.exec(); } diff --git a/Userland/Utilities/date.cpp b/Userland/Utilities/date.cpp index 0b919216228..bf23092de91 100644 --- a/Userland/Utilities/date.cpp +++ b/Userland/Utilities/date.cpp @@ -29,8 +29,6 @@ ErrorOr serenity_main(Main::Arguments arguments) args_parser.add_option(print_rfc_5322, "Print date in RFC 5322 format", "rfc-5322", 'R'); args_parser.parse(arguments); - tzset(); - if (set_date != nullptr) { auto number = String(set_date).to_uint(); diff --git a/Userland/Utilities/ddate.cpp b/Userland/Utilities/ddate.cpp index e6f5c3c63aa..9e7d8ce66be 100644 --- a/Userland/Utilities/ddate.cpp +++ b/Userland/Utilities/ddate.cpp @@ -8,7 +8,6 @@ #include #include #include -#include #include class DiscordianDate { @@ -105,8 +104,6 @@ ErrorOr serenity_main(Main::Arguments) { TRY(Core::System::pledge("stdio rpath")); - tzset(); - auto date = Core::DateTime::now(); outln("Today is {}", DiscordianDate(date).to_string()); diff --git a/Userland/Utilities/fortune.cpp b/Userland/Utilities/fortune.cpp index 5d5aac36412..324ec17874b 100644 --- a/Userland/Utilities/fortune.cpp +++ b/Userland/Utilities/fortune.cpp @@ -17,7 +17,6 @@ #include #include #include -#include #include class Quote { @@ -88,8 +87,6 @@ ErrorOr serenity_main(Main::Arguments arguments) TRY(Core::System::unveil("/etc/timezone", "r")); TRY(Core::System::unveil(nullptr, nullptr)); - tzset(); - auto file_contents = file->read_all(); auto json = TRY(JsonValue::from_string(file_contents)); if (!json.is_array()) { diff --git a/Userland/Utilities/js.cpp b/Userland/Utilities/js.cpp index 199c61da5ab..12e622063e1 100644 --- a/Userland/Utilities/js.cpp +++ b/Userland/Utilities/js.cpp @@ -69,7 +69,6 @@ #include #include #include -#include #include RefPtr vm; @@ -1305,8 +1304,6 @@ ErrorOr serenity_main(Main::Arguments arguments) args_parser.add_positional_argument(script_paths, "Path to script files", "scripts", Core::ArgsParser::Required::No); args_parser.parse(arguments); - tzset(); - bool syntax_highlight = !disable_syntax_highlight; vm = JS::VM::create(); diff --git a/Userland/Utilities/w.cpp b/Userland/Utilities/w.cpp index f59d7fc888b..2d4ed240f1f 100644 --- a/Userland/Utilities/w.cpp +++ b/Userland/Utilities/w.cpp @@ -25,8 +25,6 @@ ErrorOr 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()) {