X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;ds=inline;f=src%2Ftimesync%2Ftimesyncd.c;h=732f5bf6c2843e4724063e819fc6afd76fe62f2f;hb=0014a4ad505d119c7ac4346d9d774c3f17f663a5;hp=78ef5f72a1910f22f563f54a459b3a4ad9935281;hpb=ae2db4e7e868fb89f5053a962a3a43337ddfd4e0;p=elogind.git diff --git a/src/timesync/timesyncd.c b/src/timesync/timesyncd.c index 78ef5f72a..732f5bf6c 100644 --- a/src/timesync/timesyncd.c +++ b/src/timesync/timesyncd.c @@ -1095,27 +1095,10 @@ int config_parse_servers( } static int manager_parse_config_file(Manager *m) { - static const char fn[] = "/etc/systemd/timesyncd.conf"; - _cleanup_fclose_ FILE *f = NULL; - int r; - - assert(m); - - f = fopen(fn, "re"); - if (!f) { - if (errno == ENOENT) - return 0; - - log_warning("Failed to open configuration file %s: %m", fn); - return -errno; - } - - r = config_parse(NULL, fn, f, "Time\0", config_item_perf_lookup, - (void*) timesyncd_gperf_lookup, false, false, m); - if (r < 0) - log_warning("Failed to parse configuration file: %s", strerror(-r)); - - return r; + return config_parse(NULL, "/etc/systemd/timesyncd.conf", NULL, + "Time\0", + config_item_perf_lookup, timesyncd_gperf_lookup, + false, false, true, m); } static bool network_is_online(void) { @@ -1169,7 +1152,7 @@ static int manager_network_monitor_listen(Manager *m) { _cleanup_network_monitor_unref_ sd_network_monitor *monitor = NULL; int r, fd, events; - r = sd_network_monitor_new(NULL, &monitor); + r = sd_network_monitor_new(&monitor, NULL); if (r < 0) return r;