chiark / gitweb /
basic/path-util: allow flags for path_equal_or_files_same
[elogind.git] / src / basic / stat-util.c
index d262fe16a674eda3ecb7f704591367a9e4c4ca8e..0280afeecd743a210e6840a3bd43bbead2248db3 100644 (file)
@@ -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 &&