static int apply_file(const char *path, bool ignore_enoent) {
_cleanup_fclose_ FILE *f = NULL;
+ _cleanup_free_ char *pp = NULL;
int r;
assert(path);
- r = search_and_fopen(path, "re", NULL, (const char**) CONF_PATHS_STRV("binfmt.d"), &f);
+ r = search_and_fopen(path, "re", NULL, (const char**) CONF_PATHS_STRV("binfmt.d"), &f, &pp);
if (r < 0) {
if (ignore_enoent && r == -ENOENT)
return 0;
return log_error_errno(r, "Failed to open file '%s': %m", path);
}
- log_debug("apply: %s", path);
+ log_debug("apply: %s", pp);
for (;;) {
_cleanup_free_ char *line = NULL;
char *p;
k = read_line(f, LONG_LINE_MAX, &line);
if (k < 0)
- return log_error_errno(k, "Failed to read file '%s': %m", path);
+ return log_error_errno(k, "Failed to read file '%s': %m", pp);
if (k == 0)
break;