else {
char **files, **f;
- r = apply_file("/etc/sysctl.conf", true);
- files = conf_files_list(".conf",
- "/run/sysctl.d",
- "/etc/sysctl.d",
- "/usr/lib/sysctl.d",
- NULL);
+ r = conf_files_list(&files, ".conf",
+ "/run/sysctl.d",
+ "/etc/sysctl.d",
+ "/usr/local/lib/sysctl.d",
+ "/usr/lib/sysctl.d",
+ "/lib/sysctl.d",
+ NULL);
+ if (r < 0) {
+ log_error("Failed to enumerate sysctl.d files: %s", strerror(-r));
+ goto finish;
+ }
STRV_FOREACH(f, files) {
int k;
r = k;
}
+ apply_file("/etc/sysctl.conf", true);
+
strv_free(files);
}
-
+finish:
return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
}