Skip to content
Commits on Jul 30, 2005
  1. @proski

    [PATCH] mmap error handling

    proski committed with Junio C Hamano
    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
    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 <>
    Signed-off-by: Junio C Hamano <>
Something went wrong with that request. Please try again.