fs-util: port symlink_idempotent() to path_extract_directory()

This commit is contained in:
Lennart Poettering
2021-03-09 14:37:23 +00:00
committed by Luca Boccassi
parent 9ca6d78061
commit 9813d8354c
+3 -3
View File
@@ -428,9 +428,9 @@ int symlink_idempotent(const char *from, const char *to, bool make_relative) {
if (make_relative) {
_cleanup_free_ char *parent = NULL;
parent = dirname_malloc(to);
if (!parent)
return -ENOMEM;
r = path_extract_directory(to, &parent);
if (r < 0)
return r;
r = path_make_relative(parent, from, &relpath);
if (r < 0)