summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-09-12 20:29:11 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-09-13 23:22:09 +0200
commit449375d2adadb0ce7a8975876ca797ae4f926e48 (patch)
tree0792d56c1e8ea7efde06d7b026ab6a08f5872d00
parentMerge pull request #24663 from mrc0mmand/codeql-follow-up (diff)
downloadsystemd-449375d2adadb0ce7a8975876ca797ae4f926e48.tar.xz
systemd-449375d2adadb0ce7a8975876ca797ae4f926e48.zip
fs-util: use path_make_relative_parent() at one more place
-rw-r--r--src/basic/fs-util.c8
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;