strbuf_read_file(): preserve errno across close() call
authorJeff King <peff@peff.net>
Fri, 23 Feb 2018 07:00:54 +0000 (02:00 -0500)
committerJunio C Hamano <gitster@pobox.com>
Fri, 23 Feb 2018 22:20:22 +0000 (14:20 -0800)
If we encounter a read error, the user may want to report it
by looking at errno. However, our close() call may clobber
errno, leading to confusing results. Let's save and restore
it in the error case.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
No differences found