aboutsummaryrefslogtreecommitdiffstats
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
parentevas: drop redundant pointer check (diff)
downloadefl-4d13273e3b3090579e11438fd32cbbe1d64db4b4.tar.gz
Summary: dirty fix for 'eet' problems with file deletion on WINDOWS to work with the commit: https://phab.enlightenment.org/D4698, https://phab.enlightenment.org/D4699 Reviewers: cedric, NikaWhite, rimmed, vtorri, raster Reviewed By: cedric Subscribers: artem.popov, cedric, jpeg Maniphest Tasks: https://phab.enlightenment.org/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)
free(map);
}
- if (file->global_map != MAP_FAILED && file->handle != NULL)
+ if (file->global_map != MAP_FAILED)
UnmapViewOfFile(file->global_map);
if (file->handle != INVALID_HANDLE_VALUE)
@@ -730,7 +730,7 @@ eina_file_open(const char *path, Eina_Bool shared)
else
#endif
handle = CreateFile(filename,
- GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
+ GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
NULL);
@@ -832,7 +832,21 @@ eina_file_unlink(const char *pathname)
if (file->handle != INVALID_HANDLE_VALUE)
{
CloseHandle(file->handle);
- file->handle = INVALID_HANDLE_VALUE;
+
+ file->handle = CreateFile(unlink_path,
+ GENERIC_READ,
+ FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,
+ NULL,
+ OPEN_EXISTING,
+ FILE_ATTRIBUTE_NORMAL | FILE_FLAG_DELETE_ON_CLOSE,
+ NULL);
+
+ if (file->handle != INVALID_HANDLE_VALUE)
+ {
+ CloseHandle(file->handle);
+ file->handle = INVALID_HANDLE_VALUE;
+ return EINA_TRUE;
+ }
}
}