ntpquery: Use time.google.com as default NTP server for now

Using a pool.ntp.org server seems nicer and more open-source-y,
but until our pool use is approved, let's put in a default value
that works.

(time.google.com serves smeared time instead of doing leap seconds.
pool.ntp.org doesn't serve smeared time. I intend to implement
client-side leap second smearing since nobody likes jumpy timestamps.
For now, we get this for free.)
This commit is contained in:
Nico Weber 2020-09-06 09:35:34 -04:00 committed by Andreas Kling
parent 8016b2c546
commit 0736ae4116
Notes: sideshowbarker 2024-07-19 02:52:05 +09:00

View file

@ -105,13 +105,10 @@ int main(int argc, char** argv)
return 1;
}
// FIXME: Request serenityos.pool.ntp.org here https://manage.ntppool.org/manage/vendor
// and then use that as the default value.
// Until then, explicitly pass this as `ntpquery pool.ntp.org`.
const char* host = nullptr;
// FIXME: Change to serenityos.pool.ntp.org once https://manage.ntppool.org/manage/vendor/zone?a=km5a8h&id=vz-14154g is approved.
const char* host = "time.google.com";
Core::ArgsParser args_parser;
args_parser.add_positional_argument(host, "NTP server", "host", Core::ArgsParser::Required::Yes);
args_parser.add_positional_argument(host, "NTP server", "host", Core::ArgsParser::Required::No);
args_parser.parse(argc, argv);
auto* hostent = gethostbyname(host);