cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=f61f8d30fccf8cb625b1c66c7c09d39fa738e9bd

commit f61f8d30fccf8cb625b1c66c7c09d39fa738e9bd
Author: Vincent Torri <[email protected]>
Date:   Wed Jul 16 14:13:28 2014 +0200

    eina: make error message more precise.
---
 src/lib/eina/eina_file_win32.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/src/lib/eina/eina_file_win32.c b/src/lib/eina/eina_file_win32.c
index c70c19c..25fbcd9 100644
--- a/src/lib/eina/eina_file_win32.c
+++ b/src/lib/eina/eina_file_win32.c
@@ -728,7 +728,21 @@ eina_file_open(const char *path, Eina_Bool shared)
                          NULL);
 
    if (handle == INVALID_HANDLE_VALUE)
-     goto close_file;
+     {
+        switch (GetLastError())
+          {
+           case ERROR_FILE_NOT_FOUND:
+              WRN("Could not open file [%s].", filename);
+              free(filename);
+              return NULL;
+           case ERROR_PATH_NOT_FOUND:
+              WRN("Could not find file path [%s].", filename);
+              free(filename);
+              return NULL;
+           default:
+              goto free_file;
+          }
+     }
 
    if (!GetFileAttributesEx(filename, GetFileExInfoStandard, &fad))
      goto close_handle;
@@ -796,7 +810,7 @@ eina_file_open(const char *path, Eina_Bool shared)
 
  close_handle:
    CloseHandle(handle);
- close_file:
+ free_file:
    ERR("Could not open file [%s].", filename);
    free(filename);
 

-- 


Reply via email to