summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Michael <devilhorns@comcast.net>2013-07-08 16:05:12 +0100
committerChris Michael <devilhorns@comcast.net>2013-07-08 16:05:12 +0100
commita144495daa528f4f97b3a41ddd6c9b2ad3600da0 (patch)
tree3897664362058f4bcdb15e0304e81b3af458f767
parent207ad636fe9220caba76c0bf4dc9a43385868eba (diff)
Initialize 'd' to -1 so we can check on 'end' if it needs closing
Signed-off-by: Chris Michael <devilhorns@comcast.net>
Diffstat (limited to '')
-rw-r--r--src/lib/eina/eina_file_common.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/eina/eina_file_common.c b/src/lib/eina/eina_file_common.c
index 37105d56d6..f52b39fc3d 100644
--- a/src/lib/eina/eina_file_common.c
+++ b/src/lib/eina/eina_file_common.c
@@ -543,7 +543,7 @@ EAPI Eina_Bool
543eina_file_copy(const char *src, const char *dst, Eina_File_Copy_Flags flags, Eina_File_Copy_Progress cb, const void *cb_data) 543eina_file_copy(const char *src, const char *dst, Eina_File_Copy_Flags flags, Eina_File_Copy_Progress cb, const void *cb_data)
544{ 544{
545 struct stat st; 545 struct stat st;
546 int s, d; 546 int s, d = -1;
547 Eina_Bool success; 547 Eina_Bool success;
548 548
549 EINA_SAFETY_ON_NULL_RETURN_VAL(src, EINA_FALSE); 549 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
570 } 570 }
571 571
572 end: 572 end:
573 close(d); 573 if (d > 0) close(d);
574 close(s); 574 close(s);
575 575
576 if (!success) 576 if (!success)