summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b63fafd)
raw | patch | inline | side by side (parent: b63fafd)
author | Linus Torvalds <torvalds@osdl.org> | |
Mon, 31 Jul 2006 16:55:15 +0000 (09:55 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 31 Jul 2006 18:55:56 +0000 (11:55 -0700) |
Doing an "strace" on "git diff" shows that we close() a file descriptor
twice (getting EBADFD on the second one) when we end up in ce_compare_data
if the index does not match the checked-out stat information.
The "index_fd()" function will already have closed the fd for us, so we
should not close it again.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
twice (getting EBADFD on the second one) when we end up in ce_compare_data
if the index does not match the checked-out stat information.
The "index_fd()" function will already have closed the fd for us, so we
should not close it again.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
read-cache.c | patch | blob | history |
diff --git a/read-cache.c b/read-cache.c
index c0b031367bf0d33e535cdfc183da2276577c8011..f92cdaacee1b43bf09929e7072c281dbcbb09c10 100644 (file)
--- a/read-cache.c
+++ b/read-cache.c
unsigned char sha1[20];
if (!index_fd(sha1, fd, st, 0, NULL))
match = memcmp(sha1, ce->sha1, 20);
- close(fd);
+ /* index_fd() closed the file descriptor already */
}
return match;
}