systemd-sysctl: Handle missing /etc/sysctl.conf properly

Since fabe5c0e5f, systemd-sysctl returns
a non-zero exit code if /etc/sysctl.conf does not exist, due to a
broken ENOENT check.
This commit is contained in:
Eelco Dolstra 2013-03-27 13:41:59 +01:00 committed by Zbigniew Jędrzejewski-Szmek
parent f36a783ca7
commit 6f6fad96ad

View 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));