Minor error handling fixes in file_utils

Reviewers: devilhorns

Differential Revision: https://phab.enlightenment.org/D1410
This commit is contained in:
kabeer khan 2014-09-04 08:16:59 -04:00 committed by Chris Michael
parent 89c5bfab0d
commit 7ee9b2677a
1 changed files with 6 additions and 3 deletions

View File

@ -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;