aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDenis Krjuchkov <denis@crazydev.net>2013-12-05 14:41:43 +0600
committerDenis Krjuchkov <denis@crazydev.net>2013-12-05 15:05:01 +0600
commitc161bb287ce34c9e60f774a4cd5f1e8bc844b407 (patch)
treeda0e17774c1081dc8db2b112a97d1419e94a755d /src
parent06d71696745388c5663fdd676ffbfd783459f6fc (diff)
downloadmpd-c161bb287ce34c9e60f774a4cd5f1e8bc844b407.tar.gz
mpd-c161bb287ce34c9e60f774a4cd5f1e8bc844b407.tar.xz
mpd-c161bb287ce34c9e60f774a4cd5f1e8bc844b407.zip
db/SimpleDatabasePlugin.cxx: don't use CheckAccess with mode on Windows
Diffstat (limited to 'src')
-rw-r--r--src/db/SimpleDatabasePlugin.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/db/SimpleDatabasePlugin.cxx b/src/db/SimpleDatabasePlugin.cxx
index 14be91b0a..d0075ebb4 100644
--- a/src/db/SimpleDatabasePlugin.cxx
+++ b/src/db/SimpleDatabasePlugin.cxx
@@ -71,7 +71,7 @@ SimpleDatabase::Check(Error &error) const
assert(!path.IsNull());
/* Check if the file exists */
- if (!CheckAccess(path, F_OK)) {
+ if (!CheckAccess(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 */
@@ -94,6 +94,7 @@ SimpleDatabase::Check(Error &error) const
return false;
}
+#ifndef WIN32
/* Check if we can write to the directory */
if (!CheckAccess(dirPath, X_OK | W_OK)) {
const int e = errno;
@@ -102,7 +103,7 @@ SimpleDatabase::Check(Error &error) const
dirPath_utf8.c_str());
return false;
}
-
+#endif
return true;
}
@@ -121,12 +122,14 @@ SimpleDatabase::Check(Error &error) const
return false;
}
+#ifndef WIN32
/* And check that we can write to it */
if (!CheckAccess(path, R_OK | W_OK)) {
error.FormatErrno("Can't open db file \"%s\" for reading/writing",
path_utf8.c_str());
return false;
}
+#endif
return true;
}