Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2017-05-09 13:11:33 +0300
committerJunio C Hamano <gitster@pobox.com>2017-05-26 06:33:56 +0300
commitf7566f073fccafdd9e0ace514b25897dd55d217a (patch)
tree7a146efd5e27d23d59c46e14f8cd075bfea93536 /rerere.c
parent5118d7f4e6e00b7eac3ce08a16392a732edc0b2b (diff)
rerere.c: move error_errno() closer to the source system call
We are supposed to report errno from fopen(). fclose() between fopen() and the report function could either change errno or reset it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'rerere.c')
-rw-r--r--rerere.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/rerere.c b/rerere.c
index 1351b0c3fbd..c26c29f87a6 100644
--- a/rerere.c
+++ b/rerere.c
@@ -489,8 +489,9 @@ static int handle_file(const char *path, unsigned char *sha1, const char *output
if (output) {
io.io.output = fopen(output, "w");
if (!io.io.output) {
+ error_errno("Could not write %s", output);
fclose(io.input);
- return error_errno("Could not write %s", output);
+ return -1;
}
}