eina: add more debug information when failing to open a file.
authorCedric BAIL <cedric.bail@samsung.com>
Fri, 21 Feb 2014 08:13:09 +0000 (17:13 +0900)
committerCedric BAIL <cedric.bail@samsung.com>
Fri, 21 Feb 2014 08:13:09 +0000 (17:13 +0900)
src/lib/eina/eina_file.c
src/lib/eina/eina_file_win32.c

index ca2fe612dc4de0fcd8484e1581ec387d63d6bd5f..8bc1f0c5d5ca3bd58a38d66a9e25c5bbc1e65f20 100644 (file)
@@ -923,6 +923,8 @@ eina_file_open(const char *path, Eina_Bool shared)
    return n;
 
  on_error:
+   ERR("Could not open file [%s].", filename);
+
    free(filename);
    if (fd >= 0) close(fd);
    return NULL;
index 2d219a1d1c5afb8206a2778fa06b6b9b38a9c13e..5839230ca1324b991f6d14931461f0a0c819232c 100644 (file)
@@ -780,7 +780,7 @@ eina_file_open(const char *path, Eina_Bool shared)
                          NULL);
 
    if (handle == INVALID_HANDLE_VALUE)
-     return NULL;
+     goto close_file;
 
    fm = CreateFileMapping(handle, NULL, PAGE_READONLY, 0, 0, NULL);
    if (!fm)
@@ -857,6 +857,7 @@ eina_file_open(const char *path, Eina_Bool shared)
  close_handle:
    CloseHandle(handle);
 
+ close_file:
    ERR("Could not open file [%s].", filename);
    free(filename);