summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2017-02-16 14:45:15 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-02-16 14:45:15 -0800
commitc5b22b819dd5fe415b1a8a5e4aceb64f20ab3144 (patch)
tree226e5db54a185572821357ca9b717e37b55c9353
parentMerge branch 'dp/submodule-doc-markup-fix' (diff)
parenttempfile: avoid "ferror | fclose" trick (diff)
downloadtgif-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.c8
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);
}