1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-11 05:17:44 +03:00

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

This commit is contained in:
Lennart Poettering 2021-03-08 20:41:34 +01:00 committed by Luca Boccassi
parent 9ca6d78061
commit 9813d8354c

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)