config: replace numeric enable_sync setting with time_sync string
This shouldn't break existing configs. Existing "enable_sync" setings are automatically replaced with an appropriate "time_sync" value. In case "enable_sync" and "time_sync" settings are both present in a configuration file (shouldn't happen without manually editing the config), "time_sync" takes precedence.
This commit is contained in:
@@ -181,10 +181,10 @@ nvr_init(nvr_t *nvr)
|
||||
|
||||
/* Initialize the internal clock as needed. */
|
||||
memset(&intclk, 0x00, sizeof(intclk));
|
||||
if (enable_sync & TIME_SYNC_ENABLED) {
|
||||
if (time_sync & TIME_SYNC_ENABLED) {
|
||||
/* Get the current time of day, and convert to local time. */
|
||||
(void)time(&now);
|
||||
if(enable_sync & TIME_SYNC_UTC)
|
||||
if(time_sync & TIME_SYNC_UTC)
|
||||
tm = gmtime(&now);
|
||||
else
|
||||
tm = localtime(&now);
|
||||
|
||||
Reference in New Issue
Block a user