1
0
mirror of https://github.com/git/git synced 2024-07-05 00:58:49 +00:00

Improve error message when packfile mmap fails.

If we are unable to mmap the a region of the packfile with the mmap()
system call there may be a good reason why, such as a closed file
descriptor or out of address space.  Reporting the system level
error message can help to debug such problems.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Shawn O. Pearce 2006-12-23 02:34:41 -05:00 committed by Junio C Hamano
parent 40be82723c
commit 73b4e4be71

View File

@ -590,7 +590,9 @@ unsigned char* use_pack(struct packed_git *p,
PROT_READ, MAP_PRIVATE,
p->pack_fd, win->offset);
if (win->base == MAP_FAILED)
die("packfile %s cannot be mapped.", p->pack_name);
die("packfile %s cannot be mapped: %s",
p->pack_name,
strerror(errno));
win->next = p->windows;
p->windows = win;
}