Time: Run synchronization on network up.

Also move the settings check into launch_daemon, as that way
"Time --update" can be invoked even when the setting is disabled.

Fixes #9348.
This commit is contained in:
Augustin Cavalier 2019-04-07 15:12:39 -04:00
parent 2e95cfdadd
commit eb3cdd8a25
2 changed files with 2 additions and 3 deletions

View File

@ -37,6 +37,8 @@ target desktop {
job update-time {
launch /system/preferences/Time "" --update
if setting ~/config/settings/networktime\ settings "synchronize at boot"
on network_available
}
job first-login {

View File

@ -91,9 +91,6 @@ main(int argc, char** argv)
return 0;
Settings settings;
if (!settings.GetSynchronizeAtBoot())
return 0;
const char* errorString = NULL;
int32 errorCode = 0;
if (update_time(settings, &errorString, &errorCode) == B_OK) {