summaryrefslogtreecommitdiff
path: root/drivers/unix
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-06-13 10:10:50 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-06-13 10:10:50 -0300
commit7f02627290cedf2d5ef6b45cddc6117c763cb15b (patch)
treee25e3f1a33e63a941732c8e920908c3e20bab113 /drivers/unix
parentf0abda999e179faf1577026d0369062349cb4897 (diff)
-Add visible IO errors when closing a file fails due to it being locked (most likely on windows), closes #4760
Diffstat (limited to 'drivers/unix')
-rw-r--r--drivers/unix/file_access_unix.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/unix/file_access_unix.cpp b/drivers/unix/file_access_unix.cpp
index 9f24633bd4..2838e7d913 100644
--- a/drivers/unix/file_access_unix.cpp
+++ b/drivers/unix/file_access_unix.cpp
@@ -124,6 +124,11 @@ void FileAccessUnix::close() {
//unlink(save_path.utf8().get_data());
//print_line("renaming..");
int rename_error = rename((save_path+".tmp").utf8().get_data(),save_path.utf8().get_data());
+
+ if (rename_error && close_fail_notify) {
+ close_fail_notify(save_path);
+ }
+
save_path="";
ERR_FAIL_COND( rename_error != 0);
}