summaryrefslogtreecommitdiff
path: root/src/delta
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-11-18 21:35:21 +0100
committerLennart Poettering <lennart@poettering.net>2016-12-01 00:25:51 +0100
commite187369587b1c6a5f65a12e7ec0bf7844905d014 (patch)
tree30d7395e3ed58b073506d37d30d0c5f76aee71cf /src/delta
parentc9d5c9c0e19eea79ca0f09fe58e5c0b76b8001e2 (diff)
tree-wide: stop using canonicalize_file_name(), use chase_symlinks() instead
Let's use chase_symlinks() everywhere, and stop using GNU canonicalize_file_name() everywhere. For most cases this should not change behaviour, however increase exposure of our function to get better tested. Most importantly in a few cases (most notably nspawn) it can take the correct root directory into account when chasing symlinks.
Diffstat (limited to 'src/delta')
-rw-r--r--src/delta/delta.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/delta/delta.c b/src/delta/delta.c
index 04de75475d..70ff793304 100644
--- a/src/delta/delta.c
+++ b/src/delta/delta.c
@@ -87,14 +87,15 @@ static enum {
static int equivalent(const char *a, const char *b) {
_cleanup_free_ char *x = NULL, *y = NULL;
+ int r;
- x = canonicalize_file_name(a);
- if (!x)
- return -errno;
+ r = chase_symlinks(a, NULL, &x);
+ if (r < 0)
+ return r;
- y = canonicalize_file_name(b);
- if (!y)
- return -errno;
+ r = chase_symlinks(b, NULL, &y);
+ if (r < 0)
+ return r;
return path_equal(x, y);
}