summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-07-22 08:54:27 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-07-22 16:03:00 -0400
commit3f6de63bf73b79fd19ece75844cd33bc6f188fa7 (patch)
tree0dc10a3e9bfaf09e2a6524068c43302e1270d74b /src
parent9e4ea9cc34fa032a47c253ddd94ac6c7afda663e (diff)
downloadsystemd-3f6de63bf73b79fd19ece75844cd33bc6f188fa7.tar.gz
shared/dropin: improve error message
We're not just sorting, but actually creating the list. We can also use the output parameter directly, without a temporary variable.
Diffstat (limited to 'src')
-rw-r--r--src/shared/dropin.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/shared/dropin.c b/src/shared/dropin.c
index 15ccd1b6ca..7d8fbeb435 100644
--- a/src/shared/dropin.c
+++ b/src/shared/dropin.c
@@ -187,7 +187,7 @@ int unit_file_find_dropin_paths(
Set *names,
char ***ret) {
- _cleanup_strv_free_ char **dirs = NULL, **ans = NULL;
+ _cleanup_strv_free_ char **dirs = NULL;
Iterator i;
char *t, **p;
int r;
@@ -203,12 +203,9 @@ int unit_file_find_dropin_paths(
return 0;
}
- r = conf_files_list_strv(&ans, file_suffix, NULL, (const char**) dirs);
+ r = conf_files_list_strv(ret, file_suffix, NULL, (const char**) dirs);
if (r < 0)
- return log_warning_errno(r, "Failed to sort the list of configuration files: %m");
-
- *ret = ans;
- ans = NULL;
+ return log_warning_errno(r, "Failed to create the list of configuration files: %m");
return 1;
}