Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
rerere.c: move error_errno() closer to the source system call
author
Nguyễn Thái Ngọc Duy
<pclouds@gmail.com>
Tue, 9 May 2017 10:11:33 +0000
(17:11 +0700)
committer
Junio C Hamano
<gitster@pobox.com>
Fri, 26 May 2017 03:33:56 +0000
(12:33 +0900)
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>
rerere.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
5118d7f
)
diff --git
a/rerere.c
b/rerere.c
index 1351b0c3fbd47e9f6e913e586081a7317670f807..c26c29f87a6f35d2efffd226fa8922f36cd0bb37 100644
(file)
--- 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
;
}
}