Skip to content

Commit

Permalink
shared/dropin: improve error message
Browse files Browse the repository at this point in the history
We're not just sorting, but actually creating the list. We can
also use the output parameter directly, without a temporary variable.
  • Loading branch information
keszybz committed Jul 22, 2017
1 parent 9e4ea9c commit 3f6de63
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/shared/dropin.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}

0 comments on commit 3f6de63

Please sign in to comment.