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.
This commit is contained in:
@@ -169,16 +169,16 @@ int path_is_os_tree(const char *path) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
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 &&
|
||||
|
||||
Reference in New Issue
Block a user