chiark / gitweb /
stdio-bridge: rework stdio bridge to use libsystemd-bus
[elogind.git] / src / sysctl / sysctl.c
index a8cbb5a326d137df647fb290c794e0246f745b5e..79f3f77676c81efdf3cc584123d9131e23402d0d 100644 (file)
@@ -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));