devilhorns pushed a commit to branch master.

http://git.enlightenment.org/apps/ecrire.git/commit/?id=7ee9b2677a3218f55fa284c721d8b5b56ee8b47c

commit 7ee9b2677a3218f55fa284c721d8b5b56ee8b47c
Author: kabeer khan <[email protected]>
Date:   Thu Sep 4 08:16:59 2014 -0400

    Minor error handling fixes in file_utils
    
    Reviewers: devilhorns
    
    Differential Revision: https://phab.enlightenment.org/D1410
---
 src/bin/file_utils.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/bin/file_utils.c b/src/bin/file_utils.c
index fe32856..5c4c997 100644
--- a/src/bin/file_utils.c
+++ b/src/bin/file_utils.c
@@ -66,13 +66,16 @@ _save_markup_utf8(const char *file, const char *text)
    f = fopen(file, "wb");
    if (!f)
      {
-        // FIXME: report a write error
+        EINA_LOG_ERR("could not open '%s' for writing.", file);
         return EINA_FALSE;
      }
-
    if (text)
      {
-        fputs(text, f); // FIXME: catch error
+        if(fputs(text, f)==EOF)
+          {
+             EINA_LOG_ERR("Error in writing to '%s'.", file);  
+             return EINA_FALSE;
+          } 
      }
    fclose(f);
    return EINA_TRUE;

-- 


Reply via email to