aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/db/plugins/simple/SimpleDatabasePlugin.cxx2
-rw-r--r--src/fs/FileSystem.hxx22
2 files changed, 7 insertions, 17 deletions
diff --git a/src/db/plugins/simple/SimpleDatabasePlugin.cxx b/src/db/plugins/simple/SimpleDatabasePlugin.cxx
index da8d44fb0..913141d22 100644
--- a/src/db/plugins/simple/SimpleDatabasePlugin.cxx
+++ b/src/db/plugins/simple/SimpleDatabasePlugin.cxx
@@ -117,7 +117,7 @@ SimpleDatabase::Check(Error &error) const
assert(!path.IsNull());
/* Check if the file exists */
- if (!CheckAccess(path)) {
+ if (!PathExists(path)) {
/* If the file doesn't exist, we can't check if we can write
* it, so we are going to try to get the directory path, and
* see if we can write a file in that */
diff --git a/src/fs/FileSystem.hxx b/src/fs/FileSystem.hxx
index ab19b8b63..6f19c8ed3 100644
--- a/src/fs/FileSystem.hxx
+++ b/src/fs/FileSystem.hxx
@@ -123,20 +123,6 @@ CheckAccess(Path path, int mode)
#endif
/**
- * Checks is specified path exists and accessible.
- */
-static inline bool
-CheckAccess(Path path)
-{
-#ifdef WIN32
- struct stat buf;
- return StatFile(path, buf);
-#else
- return CheckAccess(path, F_OK);
-#endif
-}
-
-/**
* Checks if #Path exists and is a regular file.
*/
static inline bool
@@ -160,10 +146,14 @@ DirectoryExists(Path path, bool follow_symlinks = true)
* Checks if #Path exists.
*/
static inline bool
-PathExists(Path path, bool follow_symlinks = true)
+PathExists(Path path)
{
+#ifdef WIN32
struct stat buf;
- return StatFile(path, buf, follow_symlinks);
+ return StatFile(path, buf);
+#else
+ return CheckAccess(path, F_OK);
+#endif
}
#endif