On Fri, Mar 11, 2016 at 3:14 PM, Michaël Bouchaud <[email protected]> wrote: > and what about the close of fd if blen is 0
You're right, I missed that. D5 > > 2016-03-11 14:16 GMT+01:00 Daniel Kolesa <[email protected]>: > >> q66 pushed a commit to branch master. >> >> >> http://git.enlightenment.org/core/efl.git/commit/?id=97adf6d52bd726520524873e846c3f847439cf55 >> >> commit 97adf6d52bd726520524873e846c3f847439cf55 >> Author: Daniel Kolesa <[email protected]> >> Date: Fri Mar 11 13:16:34 2016 +0000 >> >> eolian generator: check fwrite return value currectly >> >> This fixes CID 1327247. >> >> @fix >> --- >> src/bin/eolian/main.c | 14 ++++++++++++-- >> 1 file changed, 12 insertions(+), 2 deletions(-) >> >> diff --git a/src/bin/eolian/main.c b/src/bin/eolian/main.c >> index 77ad87f..f545960 100644 >> --- a/src/bin/eolian/main.c >> +++ b/src/bin/eolian/main.c >> @@ -105,8 +105,18 @@ _write_file(const char *filename, const Eina_Strbuf >> *buffer, Eina_Bool append) >> return EINA_FALSE; >> } >> >> - if (eina_strbuf_length_get(buffer)) >> - fwrite(eina_strbuf_string_get(buffer), 1, >> eina_strbuf_length_get(buffer), fd); >> + size_t blen = eina_strbuf_length_get(buffer); >> + if (!blen) >> + return EINA_TRUE; >> + >> + if (fwrite(eina_strbuf_string_get(buffer), 1, blen, fd) != blen) >> + { >> + fprintf(stderr, "eolian: could not write '%s' (%s)\n", >> + filename, strerror(errno)); >> + fclose(fd); >> + return EINA_FALSE; >> + } >> + >> fclose(fd); >> return EINA_TRUE; >> } >> >> -- >> >> >> > > > -- > Michaël Bouchaud (yoz) <[email protected]> > ------------------------------------------------------------------------------ > Transform Data into Opportunity. > Accelerate data analysis in your applications with > Intel Data Analytics Acceleration Library. > Click to learn more. > http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140 > _______________________________________________ > enlightenment-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel ------------------------------------------------------------------------------ Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140 _______________________________________________ enlightenment-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
