devilhorns pushed a commit to branch master.

commit a144495daa528f4f97b3a41ddd6c9b2ad3600da0
Author: Chris Michael <[email protected]>
Date:   Mon Jul 8 16:05:12 2013 +0100

    Initialize 'd' to -1 so we can check on 'end' if it needs closing
    
    Signed-off-by: Chris Michael <[email protected]>
---
 src/lib/eina/eina_file_common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lib/eina/eina_file_common.c b/src/lib/eina/eina_file_common.c
index 37105d5..f52b39f 100644
--- a/src/lib/eina/eina_file_common.c
+++ b/src/lib/eina/eina_file_common.c
@@ -543,7 +543,7 @@ EAPI Eina_Bool
 eina_file_copy(const char *src, const char *dst, Eina_File_Copy_Flags flags, 
Eina_File_Copy_Progress cb, const void *cb_data)
 {
    struct stat st;
-   int s, d;
+   int s, d = -1;
    Eina_Bool success;
 
    EINA_SAFETY_ON_NULL_RETURN_VAL(src, EINA_FALSE);
@@ -570,7 +570,7 @@ eina_file_copy(const char *src, const char *dst, 
Eina_File_Copy_Flags flags, Ein
      }
 
  end:
-   close(d);
+   if (d > 0) close(d);
    close(s);
 
    if (!success)

-- 

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

Build for Windows Store.

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

Reply via email to