diff options
author | Lennart Poettering <lennart@poettering.net> | 2021-05-03 18:18:09 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2021-05-07 16:43:26 +0200 |
commit | 2708160ccda8727de80442cbf634489a360ca001 (patch) | |
tree | 2c9e2d90210a41fdcf77c3ca4b01173af306768c /src/tmpfiles | |
parent | Merge pull request #19391 from poettering/dissect-grow (diff) | |
download | systemd-2708160ccda8727de80442cbf634489a360ca001.tar.xz systemd-2708160ccda8727de80442cbf634489a360ca001.zip |
fileio: optionally, return discovered path of file in search_and_fopen()
Diffstat (limited to 'src/tmpfiles')
-rw-r--r-- | src/tmpfiles/tmpfiles.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index 98f14bbbe7..9529b09b3f 100644 --- a/src/tmpfiles/tmpfiles.c +++ b/src/tmpfiles/tmpfiles.c @@ -3185,6 +3185,7 @@ static int parse_argv(int argc, char *argv[]) { static int read_config_file(char **config_dirs, const char *fn, bool ignore_enoent, bool *invalid_config) { _cleanup_(hashmap_freep) Hashmap *uid_cache = NULL, *gid_cache = NULL; _cleanup_fclose_ FILE *_f = NULL; + _cleanup_free_ char *pp = NULL; unsigned v = 0; FILE *f; ItemArray *ia; @@ -3197,7 +3198,7 @@ static int read_config_file(char **config_dirs, const char *fn, bool ignore_enoe fn = "<stdin>"; f = stdin; } else { - r = search_and_fopen(fn, "re", arg_root, (const char**) config_dirs, &_f); + r = search_and_fopen(fn, "re", arg_root, (const char**) config_dirs, &_f, &pp); if (r < 0) { if (ignore_enoent && r == -ENOENT) { log_debug_errno(r, "Failed to open \"%s\", ignoring: %m", fn); @@ -3206,7 +3207,9 @@ static int read_config_file(char **config_dirs, const char *fn, bool ignore_enoe return log_error_errno(r, "Failed to open '%s': %m", fn); } - log_debug("Reading config file \"%s\"…", fn); + + log_debug("Reading config file \"%s\"…", pp); + fn = pp; f = _f; } |