]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/load-fragment: empty assignment to PIDFile= resets the value
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 6 Feb 2019 16:41:26 +0000 (17:41 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 6 Feb 2019 16:58:24 +0000 (17:58 +0100)
Follow-up for a9353a5c5b512f107955e56a9812724f40b841d3.

src/core/load-fragment.c

index 159e8d5050857f58288245b5c3cf837e7a9ed171..44f00a30460b10ae166969c7448fa9157be42248 100644 (file)
@@ -4254,6 +4254,12 @@ int config_parse_pid_file(
         assert(rvalue);
         assert(u);
 
+        if (isempty(rvalue)) {
+                /* An empty assignment removes already set value. */
+                *s = mfree(*s);
+                return 0;
+        }
+
         r = unit_full_printf(u, rvalue, &k);
         if (r < 0) {
                 log_syntax(unit, LOG_ERR, filename, line, r, "Failed to resolve unit specifiers in '%s', ignoring: %m", rvalue);