]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'jk/tempfile-ferror-fclose-confusion' into maint
authorJunio C Hamano <gitster@pobox.com>
Tue, 21 Mar 2017 22:03:28 +0000 (15:03 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 21 Mar 2017 22:03:28 +0000 (15:03 -0700)
A caller of tempfile API that uses stdio interface to write to
files may ignore errors while writing, which is detected when
tempfile is closed (with a call to ferror()).  By that time, the
original errno that may have told us what went wrong is likely to
be long gone and was overwritten by an irrelevant value.
close_tempfile() now resets errno to EIO to make errno at least
predictable.

* jk/tempfile-ferror-fclose-confusion:
  tempfile: set errno to a known value before calling ferror()


Trivial merge