Merge branch 'jk/tempfile-ferror-fclose-confusion'

Code clean-up.

* jk/tempfile-ferror-fclose-confusion:
  tempfile: avoid "ferror | fclose" trick
This commit is contained in:
Junio C Hamano 2017-02-16 14:45:15 -08:00
commit c5b22b819d

View File

@ -247,12 +247,8 @@ int close_tempfile(struct tempfile *tempfile)
tempfile->fd = -1;
if (fp) {
tempfile->fp = NULL;
/*
* Note: no short-circuiting here; we want to fclose()
* in any case!
*/
err = ferror(fp) | fclose(fp);
err = ferror(fp);
err |= fclose(fp);
} else {
err = close(fd);
}