chiark / gitweb /
systemd-sysctl: Handle missing /etc/sysctl.conf properly
authorEelco Dolstra <eelco.dolstra@logicblox.com>
Wed, 27 Mar 2013 12:41:59 +0000 (13:41 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 27 Mar 2013 16:01:44 +0000 (12:01 -0400)
Since fabe5c0e5fce730aa66e10a9c4f9fdd443d7aeda, systemd-sysctl returns
a non-zero exit code if /etc/sysctl.conf does not exist, due to a
broken ENOENT check.

src/sysctl/sysctl.c

index 2d43660bb5285a8eaf5435f04a7be2bd8f2ec45f..79f3f77676c81efdf3cc584123d9131e23402d0d 100644 (file)
@@ -125,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));