#include "hashmap.h"
#include "path-util.h"
#include "conf-files.h"
+#include "fileio.h"
static char **arg_prefixes = NULL;
}
}
- 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));
r = search_and_fopen_nulstr(path, "re", conf_file_dirs, &f);
if (r < 0) {
- if (ignore_enoent && errno == -ENOENT)
+ if (ignore_enoent && r == -ENOENT)
return 0;
log_error("Failed to open file '%s', ignoring: %s", path, strerror(-r));
if (!*p)
continue;
- if (strchr(COMMENTS, *p))
+ if (strchr(COMMENTS "\n", *p))
continue;
value = strchr(p, '=');
existing = hashmap_get(sysctl_options, p);
if (existing) {
if (!streq(value, existing))
- log_warning("Two ore more conflicting assignments of %s, ignoring.", property);
+ log_warning("Duplicate assignment of %s in file '%s', ignoring.",
+ p, path);
continue;
}