Skip to content

Commit f7566f0

Browse files
pcloudsgitster
authored andcommitted
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 <[email protected]>
1 parent 5118d7f commit f7566f0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rerere.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,8 +489,9 @@ static int handle_file(const char *path, unsigned char *sha1, const char *output
489489
if (output) {
490490
io.io.output = fopen(output, "w");
491491
if (!io.io.output) {
492+
error_errno("Could not write %s", output);
492493
fclose(io.input);
493-
return error_errno("Could not write %s", output);
494+
return -1;
494495
}
495496
}
496497

0 commit comments

Comments
 (0)