From: Eelco Dolstra Date: Wed, 27 Mar 2013 12:41:59 +0000 (+0100) Subject: systemd-sysctl: Handle missing /etc/sysctl.conf properly X-Git-Tag: v200~11 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=6f6fad96addf6b00b55c98cc0d0d8026b0c1e7ca;p=elogind.git systemd-sysctl: Handle missing /etc/sysctl.conf properly Since fabe5c0e5fce730aa66e10a9c4f9fdd443d7aeda, systemd-sysctl returns a non-zero exit code if /etc/sysctl.conf does not exist, due to a broken ENOENT check. --- diff --git a/src/sysctl/sysctl.c b/src/sysctl/sysctl.c index 2d43660bb..79f3f7767 100644 --- a/src/sysctl/sysctl.c +++ b/src/sysctl/sysctl.c @@ -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));