]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
timesync: return earlier when an empty string is specified
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 16 Feb 2026 00:51:36 +0000 (09:51 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 16 Feb 2026 00:51:36 +0000 (09:51 +0900)
src/timesync/timesyncd-conf.c

index 1ae4156520157421869acdc595818d00a9fcf7ce..f0af1f9d437b63c75a203167d4e02a8d9daeec65 100644 (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;