timesync: return earlier when an empty string is specified

This commit is contained in:
Yu Watanabe
2026-02-16 09:51:36 +09:00
parent 1bb9306f1e
commit b0ca2ef264

View File

@@ -84,15 +84,16 @@ int config_parse_servers(
assert(lvalue);
assert(rvalue);
if (isempty(rvalue))
if (isempty(rvalue)) {
manager_flush_server_names(m, ltype);
else {
r = manager_parse_server_string(m, ltype, rvalue);
if (r < 0) {
log_syntax(unit, LOG_WARNING, filename, line, r,
"Failed to parse NTP server string '%s', ignoring: %m", rvalue);
return 0;
}
return 0;
}
r = manager_parse_server_string(m, ltype, rvalue);
if (r < 0) {
log_syntax(unit, LOG_WARNING, filename, line, r,
"Failed to parse NTP server string '%s', ignoring: %m", rvalue);
return 0;
}
return 0;