cedric pushed a commit to branch master.

commit 79b102f6fdb9ce3fe2b02cc4601283f0f60352ea
Author: Jean-Philippe Andre <[email protected]>
Date:   Tue Jul 2 14:29:47 2013 +0900

    evas/cserve2: add some more error debug (client side).
    
    Signed-off-by: Cedric Bail <[email protected]>
---
 src/lib/evas/cserve2/evas_cs2_client.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/lib/evas/cserve2/evas_cs2_client.c 
b/src/lib/evas/cserve2/evas_cs2_client.c
index 3084550..5ebd35c 100644
--- a/src/lib/evas/cserve2/evas_cs2_client.c
+++ b/src/lib/evas/cserve2/evas_cs2_client.c
@@ -446,7 +446,10 @@ _loaded_handle(Image_Entry *ie, const Msg_Loaded *msg, int 
size)
    shmpath = ((const char *)msg) + sizeof(*msg);
    if ((size < (int) sizeof(*msg) + 1)
        || (strnlen(shmpath, size - sizeof(*msg)) >= (size - sizeof(*msg))))
-     goto fail;
+     {
+        DBG("invalid message size");
+        goto fail;
+     }
 
    // dentry->shm.path = strdup(shmpath);
    dentry->shm.mmap_offset = msg->shm.mmap_offset;
@@ -456,7 +459,10 @@ _loaded_handle(Image_Entry *ie, const Msg_Loaded *msg, int 
size)
 
    dentry->shm.f = eina_file_open(shmpath, EINA_TRUE);
    if (!dentry->shm.f)
-     goto fail;
+     {
+        DBG("could not open the shm file: %d %m", errno);
+        goto fail;
+     }
 
    dentry->shm.data = eina_file_map_new(dentry->shm.f, EINA_FILE_WILLNEED,
                                         dentry->shm.mmap_offset,
@@ -464,6 +470,7 @@ _loaded_handle(Image_Entry *ie, const Msg_Loaded *msg, int 
size)
 
    if (!dentry->shm.data)
      {
+        DBG("could not mmap the shm file: %d %m", errno);
         eina_file_close(dentry->shm.f);
         goto fail;
      }

-- 

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev

Reply via email to