diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-09-12 20:29:11 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-09-13 23:22:09 +0200 |
commit | 449375d2adadb0ce7a8975876ca797ae4f926e48 (patch) | |
tree | 0792d56c1e8ea7efde06d7b026ab6a08f5872d00 | |
parent | Merge pull request #24663 from mrc0mmand/codeql-follow-up (diff) | |
download | systemd-449375d2adadb0ce7a8975876ca797ae4f926e48.tar.xz systemd-449375d2adadb0ce7a8975876ca797ae4f926e48.zip |
fs-util: use path_make_relative_parent() at one more place
-rw-r--r-- | src/basic/fs-util.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/basic/fs-util.c b/src/basic/fs-util.c index d1272fb04b..a0898bf4f5 100644 --- a/src/basic/fs-util.c +++ b/src/basic/fs-util.c @@ -406,13 +406,7 @@ int symlink_idempotent(const char *from, const char *to, bool make_relative) { assert(to); if (make_relative) { - _cleanup_free_ char *parent = NULL; - - r = path_extract_directory(to, &parent); - if (r < 0) - return r; - - r = path_make_relative(parent, from, &relpath); + r = path_make_relative_parent(to, from, &relpath); if (r < 0) return r; |