]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
fs-util: use path_make_relative_parent() at one more place
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 12 Sep 2022 18:29:11 +0000 (03:29 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 13 Sep 2022 21:22:09 +0000 (06:22 +0900)
src/basic/fs-util.c

index d1272fb04b1c12a9824aaad077de2f9c203c3a51..a0898bf4f5da4e62c02419e6671faefc2c7fdf26 100644 (file)
@@ -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;