Browse Source

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

Code clean-up.

* jk/tempfile-ferror-fclose-confusion:
  tempfile: avoid "ferror | fclose" trick
maint
Junio C Hamano 8 years ago
parent
commit
c5b22b819d
  1. 8
      tempfile.c

8
tempfile.c

@ -247,12 +247,8 @@ int close_tempfile(struct tempfile *tempfile) @@ -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);
}

Loading…
Cancel
Save