X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fsysctl%2Fsysctl.c;h=79f3f77676c81efdf3cc584123d9131e23402d0d;hb=80cfe9e163b1c92f917e0a5e053b148fca790677;hp=f59a85832366f6439d29afb3942fe5b8877f5cd5;hpb=fabe5c0e5fce730aa66e10a9c4f9fdd443d7aeda;p=elogind.git diff --git a/src/sysctl/sysctl.c b/src/sysctl/sysctl.c index f59a85832..79f3f7767 100644 --- a/src/sysctl/sysctl.c +++ b/src/sysctl/sysctl.c @@ -34,6 +34,7 @@ #include "hashmap.h" #include "path-util.h" #include "conf-files.h" +#include "fileio.h" static char **arg_prefixes = NULL; @@ -124,7 +125,7 @@ static int parse_file(Hashmap *sysctl_options, const char *path, bool ignore_eno 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)); @@ -169,7 +170,8 @@ static int parse_file(Hashmap *sysctl_options, const char *path, bool ignore_eno 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; }