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>
This commit is contained in:

committed by
Junio C Hamano

parent
5118d7f4e6
commit
f7566f073f
3
rerere.c
3
rerere.c
@ -489,8 +489,9 @@ static int handle_file(const char *path, unsigned char *sha1, const char *output
|
|||||||
if (output) {
|
if (output) {
|
||||||
io.io.output = fopen(output, "w");
|
io.io.output = fopen(output, "w");
|
||||||
if (!io.io.output) {
|
if (!io.io.output) {
|
||||||
|
error_errno("Could not write %s", output);
|
||||||
fclose(io.input);
|
fclose(io.input);
|
||||||
return error_errno("Could not write %s", output);
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user