diff options
author | Vyacheslav Reutskiy <v.reutskiy@samsung.com> | 2016-11-23 15:43:40 +0200 |
---|---|---|
committer | Vyacheslav Reutskiy <v.reutskiy@samsung.com> | 2016-11-23 16:19:55 +0200 |
commit | 56c202614b73f0e4c34d7a5cd070fe2b24d9217f (patch) | |
tree | 4daddff0ed10de493ab090d4833a26f019a68224 /src/lib | |
parent | 164ece9e3f9ce0c011255d6f420ba660b48f35a9 (diff) |
eina_file_win32: close handler in case of error
Func _eina_file_win32_first_file try to find the first file in directory
but if any file not found the file handler stay open, and func will
return error. But in this case while handle is open impossible to do
any actions. For example call eina_file_ls for empty folder, func will
return error and fold folder open. And if we try to remove this folder
Windows only mark it to delete, and remove it after the process is
complete.
Solution: close handler in error case.
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/eina/eina_file_win32.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/eina/eina_file_win32.c b/src/lib/eina/eina_file_win32.c index 2df5956420..54b5d900db 100644 --- a/src/lib/eina/eina_file_win32.c +++ b/src/lib/eina/eina_file_win32.c | |||
@@ -160,7 +160,10 @@ _eina_file_win32_first_file(const char *dir, WIN32_FIND_DATA *fd) | |||
160 | ((fd->cFileName[1] == '.') && (fd->cFileName[2] == '\0')))) | 160 | ((fd->cFileName[1] == '.') && (fd->cFileName[2] == '\0')))) |
161 | { | 161 | { |
162 | if (!FindNextFile(h, fd)) | 162 | if (!FindNextFile(h, fd)) |
163 | return INVALID_HANDLE_VALUE; | 163 | { |
164 | FindClose(h); | ||
165 | return INVALID_HANDLE_VALUE; | ||
166 | } | ||
164 | } | 167 | } |
165 | 168 | ||
166 | return h; | 169 | return h; |