diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-02-16 14:45:15 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-02-16 14:45:15 -0800 |
commit | c5b22b819dd5fe415b1a8a5e4aceb64f20ab3144 (patch) | |
tree | 226e5db54a185572821357ca9b717e37b55c9353 | |
parent | Merge branch 'dp/submodule-doc-markup-fix' (diff) | |
parent | tempfile: avoid "ferror | fclose" trick (diff) | |
download | tgif-c5b22b819dd5fe415b1a8a5e4aceb64f20ab3144.tar.xz |
Merge branch 'jk/tempfile-ferror-fclose-confusion'
Code clean-up.
* jk/tempfile-ferror-fclose-confusion:
tempfile: avoid "ferror | fclose" trick
-rw-r--r-- | tempfile.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/tempfile.c b/tempfile.c index 2990c92424..ffcc272375 100644 --- a/tempfile.c +++ b/tempfile.c @@ -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); } |