diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-06-17 12:37:16 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-06-17 12:37:16 -0400 |
commit | e3f791a2b35b98cddf1f140ee5c80e5403d89afd (patch) | |
tree | 2f745f336c355e6d09a39252c680cf87b37d19f9 /src/basic/stat-util.c | |
parent | a1bb2402cb6edc4b46f6bf2bc3ed2773bb213919 (diff) | |
download | systemd-e3f791a2b35b98cddf1f140ee5c80e5403d89afd.tar.gz |
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 7e1914aa14..d87370e672 100644 --- a/src/basic/stat-util.c +++ b/src/basic/stat-util.c @@ -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 && |