aboutsummaryrefslogtreecommitdiffstats
path: root/src/fs
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2015-02-27 19:13:46 +0100
committerMax Kellermann <max@duempel.org>2015-02-27 19:13:46 +0100
commit4dd861ee2351a9e3ac32b6aa744965a683f52955 (patch)
treeb5d82b4bd6b1f69326709e7719b150d957e24283 /src/fs
parent4f0f81a047a3a5b78f28b583ee4a6518c12af578 (diff)
downloadmpd-4dd861ee2351a9e3ac32b6aa744965a683f52955.tar.gz
mpd-4dd861ee2351a9e3ac32b6aa744965a683f52955.tar.xz
mpd-4dd861ee2351a9e3ac32b6aa744965a683f52955.zip
fs/FileSystem: merge CheckAccess() into PathExists()
PathExists() should better do what CheckAccess() does, and CheckAccess() doesn't do what its name implies.
Diffstat (limited to 'src/fs')
-rw-r--r--src/fs/FileSystem.hxx22
1 files changed, 6 insertions, 16 deletions
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