chiark / gitweb /
tests: add more tests for shared/util.c
[elogind.git] / src / sysctl / sysctl.c
index 79f3f77676c81efdf3cc584123d9131e23402d0d..db18dd9f6e69f7436813ae59de99a5844932f731 100644 (file)
@@ -88,7 +88,7 @@ static int apply_sysctl(const char *property, const char *value) {
                 }
         }
 
-        k = write_one_line_file(p, value);
+        k = write_string_file(p, value);
         if (k < 0) {
                 log_full(k == -ENOENT ? LOG_DEBUG : LOG_WARNING,
                          "Failed to write '%s' to '%s': %s", value, p, strerror(-k));
@@ -149,7 +149,7 @@ static int parse_file(Hashmap *sysctl_options, const char *path, bool ignore_eno
                 if (!*p)
                         continue;
 
-                if (strchr(COMMENTS, *p))
+                if (strchr(COMMENTS "\n", *p))
                         continue;
 
                 value = strchr(p, '=');