diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2006-12-23 10:34:41 +0300 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-12-29 22:36:45 +0300 |
commit | 73b4e4be7128f75346ce6053d6da1672f243bc74 (patch) | |
tree | df0ac4eeb57f001a168589cf9c69598ffe8abb5b /sha1_file.c | |
parent | 40be82723ca35d4e95daccc3ccf6456f6876430e (diff) |
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>
Diffstat (limited to 'sha1_file.c')
-rw-r--r-- | sha1_file.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sha1_file.c b/sha1_file.c index 548535c844..63123cc47b 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -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; } |