summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Furs <i.furs@samsung.com>2017-03-15 10:49:19 -0700
committerCedric BAIL <cedric@osg.samsung.com>2017-03-15 10:49:55 -0700
commit4d13273e3b3090579e11438fd32cbbe1d64db4b4 (patch)
tree5eec9e36726e372fc63bc8b93dceb1781c9a0991
parent24ed55539d76d546a0fb29379acfe241c633ddd8 (diff)
eina_file: fixed T2244
Summary: dirty fix for 'eet' problems with file deletion on WINDOWS to work with the commit: D4698, D4699 Reviewers: cedric, NikaWhite, rimmed, vtorri, raster Reviewed By: cedric Subscribers: artem.popov, cedric, jpeg Maniphest Tasks: T2244 Differential Revision: https://phab.enlightenment.org/D4701 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
-rw-r--r--src/lib/eina/eina_file_win32.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/lib/eina/eina_file_win32.c b/src/lib/eina/eina_file_win32.c
index 9d6bf1b444..96d252909d 100644
--- a/src/lib/eina/eina_file_win32.c
+++ b/src/lib/eina/eina_file_win32.c
@@ -383,7 +383,7 @@ eina_file_real_close(Eina_File *file)
383 free(map); 383 free(map);
384 } 384 }
385 385
386 if (file->global_map != MAP_FAILED && file->handle != NULL) 386 if (file->global_map != MAP_FAILED)
387 UnmapViewOfFile(file->global_map); 387 UnmapViewOfFile(file->global_map);
388 388
389 if (file->handle != INVALID_HANDLE_VALUE) 389 if (file->handle != INVALID_HANDLE_VALUE)
@@ -730,7 +730,7 @@ eina_file_open(const char *path, Eina_Bool shared)
730 else 730 else
731#endif 731#endif
732 handle = CreateFile(filename, 732 handle = CreateFile(filename,
733 GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, 733 GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
734 NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 734 NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
735 NULL); 735 NULL);
736 736
@@ -832,7 +832,21 @@ eina_file_unlink(const char *pathname)
832 if (file->handle != INVALID_HANDLE_VALUE) 832 if (file->handle != INVALID_HANDLE_VALUE)
833 { 833 {
834 CloseHandle(file->handle); 834 CloseHandle(file->handle);
835 file->handle = INVALID_HANDLE_VALUE; 835
836 file->handle = CreateFile(unlink_path,
837 GENERIC_READ,
838 FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,
839 NULL,
840 OPEN_EXISTING,
841 FILE_ATTRIBUTE_NORMAL | FILE_FLAG_DELETE_ON_CLOSE,
842 NULL);
843
844 if (file->handle != INVALID_HANDLE_VALUE)
845 {
846 CloseHandle(file->handle);
847 file->handle = INVALID_HANDLE_VALUE;
848 return EINA_TRUE;
849 }
836 } 850 }
837 } 851 }
838 852