author | Pavel Roskin <proski@gnu.org> | |
Fri, 29 Jul 2005 14:49:14 +0000 (10:49 -0400) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sat, 30 Jul 2005 00:21:48 +0000 (17:21 -0700) | ||
commit | e35f9824159bba94eecdf22d198799701ed60940 | |
tree | 0d1d08eec92d179ce02b4c4b5e961e0f6c1feddc | tree | snapshot |
parent | 1df092d211868b3b74f5b3981fad9b195a0bedad | commit | diff |
[PATCH] mmap error handling
I have reviewed all occurrences of mmap() in git and fixed three types
of errors/defects:
1) The result is not checked.
2) The file descriptor is closed if mmap() succeeds, but not when it
fails.
3) Various casts applied to -1 are used instead of MAP_FAILED, which is
specifically defined to check mmap() return value.
[jc: This is a second round of Pavel's patch. He fixed up the problem
that close() potentially clobbering the errno from mmap, which
the first round had.]
Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
I have reviewed all occurrences of mmap() in git and fixed three types
of errors/defects:
1) The result is not checked.
2) The file descriptor is closed if mmap() succeeds, but not when it
fails.
3) Various casts applied to -1 are used instead of MAP_FAILED, which is
specifically defined to check mmap() return value.
[jc: This is a second round of Pavel's patch. He fixed up the problem
that close() potentially clobbering the errno from mmap, which
the first round had.]
Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
diff.c | diff | blob | history | |
diffcore-order.c | diff | blob | history | |
local-pull.c | diff | blob | history | |
read-cache.c | diff | blob | history | |
rev-cache.c | diff | blob | history | |
sha1_file.c | diff | blob | history | |
test-delta.c | diff | blob | history | |
tools/mailsplit.c | diff | blob | history |