[m-rev.] for review: fix bug #161

Paul Bone paul at bone.id.au
Mon May 20 15:35:59 AEST 2013


On Mon, May 20, 2013 at 01:42:47PM +1000, Julien Fischer wrote:
> 
> Fix bug #161.
> 
> In C grades, closing a file stream multiple times can lead to a segmentation
> fault on some systems (e.g. Linux), whereas on others (e.g. Mac OS X) an
> io.error exception is thrown.  (The difference is due to differences in the
> semantics of fclose.)  Try to avoid the former case by checking that the
> stream handle is non-NULL before we attempt to close it.  (mercury_close
> zeros
> out the relevant bits of the MercuryFile structure when we close a stream
> so,
> the stream handle is set to NULL the first time we close the stream.)
> 
> library/io.m:
>   As above.
> 

Try to wrap the text in the log message a little better.  Or is this Gmail
making life hard?

Other than that the patch is fine.


-- 
Paul Bone
http://www.bone.id.au



More information about the reviews mailing list