Fix Windows-to-Linux export error

Now chmod() returns ERR_UNAVAILABLE by default, to signal the caller the problem is lack of support instead of a failed operation.
This commit is contained in:
Pedro J. Estébanez
2017-12-06 20:25:41 +01:00
parent 7459ade298
commit 7fb9508cfa
2 changed files with 4 additions and 1 deletions

View File

@@ -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);