OSDN Git Service
(root)
/
git-core
/
git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5118d7f
)
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
diff --git
a/rerere.c
b/rerere.c
index
1351b0c
..
c26c29f
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
;
}
}