summaryrefslogtreecommitdiff
path: root/src/sysctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sysctl.c')
-rw-r--r--src/sysctl.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/sysctl.c b/src/sysctl.c
index 1d42e9378b..814cfea592 100644
--- a/src/sysctl.c
+++ b/src/sysctl.c
@@ -138,13 +138,17 @@ int main(int argc, char *argv[]) {
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);
+ apply_file("/etc/sysctl.conf", true);
+
+ r = conf_files_list(&files, ".conf",
+ "/run/sysctl.d",
+ "/etc/sysctl.d",
+ "/usr/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;
@@ -156,6 +160,6 @@ int main(int argc, char *argv[]) {
strv_free(files);
}
-
+finish:
return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
}