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 | 62fef5c5645ccb47894741b435d753aa3d57851b (diff) | |
parent | 0838cbc22fc9567ede7a60e800d876e733820060 (diff) | |
download | git-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.c | 8 |
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); } |