From 15f07f3172e69e87b1c6d3d03911e3dc38b0110c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sat, 17 Jun 2017 12:37:16 -0400 Subject: basic/path-util: allow flags for path_equal_or_files_same No functional change, just a new parameters and the tests that AT_SYMLINK_NOFOLLOW works as expected. --- src/basic/stat-util.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/basic/stat-util.c') diff --git a/src/basic/stat-util.c b/src/basic/stat-util.c index d262fe16a..0280afeec 100644 --- a/src/basic/stat-util.c +++ b/src/basic/stat-util.c @@ -176,16 +176,16 @@ int path_is_os_tree(const char *path) { } #endif // 0 -int files_same(const char *filea, const char *fileb) { +int files_same(const char *filea, const char *fileb, int flags) { struct stat a, b; assert(filea); assert(fileb); - if (stat(filea, &a) < 0) + if (fstatat(AT_FDCWD, filea, &a, flags) < 0) return -errno; - if (stat(fileb, &b) < 0) + if (fstatat(AT_FDCWD, fileb, &b, flags) < 0) return -errno; return a.st_dev == b.st_dev && -- cgit v1.2.3