aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-02-16 14:45:15 -0800
committerJunio C Hamano <gitster@pobox.com>2017-02-16 14:45:15 -0800
commitc5b22b819dd5fe415b1a8a5e4aceb64f20ab3144 (patch)
tree226e5db54a185572821357ca9b717e37b55c9353
parent62fef5c5645ccb47894741b435d753aa3d57851b (diff)
parent0838cbc22fc9567ede7a60e800d876e733820060 (diff)
downloadgit-c5b22b819dd5fe415b1a8a5e4aceb64f20ab3144.tar.gz
git-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 2990c9242..ffcc27237 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);
}