summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-02-16 22:45:15 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-02-16 22:45:15 (GMT)
commitc5b22b819dd5fe415b1a8a5e4aceb64f20ab3144 (patch)
tree226e5db54a185572821357ca9b717e37b55c9353
parent62fef5c5645ccb47894741b435d753aa3d57851b (diff)
parent0838cbc22fc9567ede7a60e800d876e733820060 (diff)
downloadgit-c5b22b819dd5fe415b1a8a5e4aceb64f20ab3144.zip
git-c5b22b819dd5fe415b1a8a5e4aceb64f20ab3144.tar.gz
git-c5b22b819dd5fe415b1a8a5e4aceb64f20ab3144.tar.bz2
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 2990c92..ffcc272 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);
}