-
- Downloads
[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>
Showing
- diff.c 3 additions, 1 deletiondiff.c
- diffcore-order.c 1 addition, 1 deletiondiffcore-order.c
- local-pull.c 1 addition, 1 deletionlocal-pull.c
- read-cache.c 2 additions, 2 deletionsread-cache.c
- rev-cache.c 2 additions, 4 deletionsrev-cache.c
- sha1_file.c 2 additions, 2 deletionssha1_file.c
- test-delta.c 2 additions, 0 deletionstest-delta.c
- tools/mailsplit.c 2 additions, 1 deletiontools/mailsplit.c
Loading
Please register or sign in to comment