On Sun, 29 Nov 2015 17:40:06 +0200
Urja Rannikko <urjaman(a)gmail.com> wrote:
> Hi,
>
> On Sun, Nov 22, 2015 at 7:43 PM, Stefan Tauner
> > @@ -1255,36 +1256,39 @@ int read_buf_from_file(unsigned char *buf, unsigned long size,
> > […]
> > +out:
> > + if (fclose(image)) {
> > + msg_gerr("Error: closing file \"%s\" failed: %s\n", filename, strerror(errno));
> > + ret = 1;
> > + }
> > + return ret;
> > #endif
> > }
> Why do this goto stuff and fclose fail reporting to read_buf_from_file?
> I'd suggest same handling as below for layout files etc (= (void)fclose()).
>
> If you fix that (or convince me that you want to print reading fclose
> failure), this is acked by me.
>
Fair enough... I'd rather convert all of them to report errors but I
agree that consistency is important, and the checking for errors in
that case is highly debatable anyway... so I have void-casted this one
and then discovered that fsync is not implemented in MinGW :(
I have #if-guarded the respective part in the attached patch. This
however does not commit the file as we intend to on Windows. OTOH just
fsync()ing on Unix does not provide 100% certainty either so I think
this should still get in because it is a clear improvement.
It builds fine one the build bot (where expected).
--
Kind regards/Mit freundlichen Grüßen, Stefan Tauner