diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-06-17 12:37:16 -0400 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2017-07-25 09:46:52 +0200 |
commit | 15f07f3172e69e87b1c6d3d03911e3dc38b0110c (patch) | |
tree | 40d4b08aec2bf4b7da65968c609ec47517eabf02 /src/basic/stat-util.c | |
parent | 1ea8dbd9cd30a46d8f410a7f651bd3e730d2378a (diff) |
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.
Diffstat (limited to 'src/basic/stat-util.c')
-rw-r--r-- | src/basic/stat-util.c | 6 |
1 files changed, 3 insertions, 3 deletions
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 && |