summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2017-12-06 23:16:18 +0100
committerGitHub <noreply@github.com>2017-12-06 23:16:18 +0100
commitc033be45284435ce324235d8d2e59209a8001336 (patch)
tree01be8f573acab8927df14c0fa21ca08ab2d37346
parent86fcc39fa94da2c693d7975ccab2401c5c5f377b (diff)
parent7fb9508cfa65c6abb678c1f218528192dd617ba4 (diff)
Merge pull request #14326 from RandomShaper/fix-chmod-error
Fix Windows-to-Linux export error
-rw-r--r--core/os/dir_access.cpp3
-rw-r--r--core/os/file_access.h2
2 files changed, 4 insertions, 1 deletions
diff --git a/core/os/dir_access.cpp b/core/os/dir_access.cpp
index 6d4b46f4da..e19c8e8ea5 100644
--- a/core/os/dir_access.cpp
+++ b/core/os/dir_access.cpp
@@ -333,6 +333,9 @@ Error DirAccess::copy(String p_from, String p_to, int chmod_flags) {
if (err == OK && chmod_flags != -1) {
fdst->close();
err = fdst->_chmod(p_to, chmod_flags);
+ // If running on a platform with no chmod support (i.e., Windows), don't fail
+ if (err == ERR_UNAVAILABLE)
+ err = OK;
}
memdelete(fsrc);
diff --git a/core/os/file_access.h b/core/os/file_access.h
index 455dd1ea99..6fda3d9668 100644
--- a/core/os/file_access.h
+++ b/core/os/file_access.h
@@ -141,7 +141,7 @@ public:
virtual Error reopen(const String &p_path, int p_mode_flags); ///< does not change the AccessType
- virtual Error _chmod(const String &p_path, int p_mod) { return FAILED; }
+ virtual Error _chmod(const String &p_path, int p_mod) { return ERR_UNAVAILABLE; }
static FileAccess *create(AccessType p_access); /// Create a file access (for the current platform) this is the only portable way of accessing files.
static FileAccess *create_for_path(const String &p_path);