summaryrefslogtreecommitdiff
path: root/addr2line.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-11-26 23:16:24 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-11-26 23:16:24 +0000
commitca86a063d575afddae055700f60192bb2769ed26 (patch)
tree0ab43fe28a57a1a41342939860dc6a040c12f103 /addr2line.c
parent39e7b2fb9495924e7f519a1e4f82d89f90ae78e4 (diff)
* addr2line.c (rb_dump_backtrace_with_lines): should close fd on
edge case. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'addr2line.c')
-rw-r--r--addr2line.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/addr2line.c b/addr2line.c
index 213196f..72afd3e 100644
--- a/addr2line.c
+++ b/addr2line.c
@@ -499,7 +499,9 @@ rb_dump_backtrace_with_lines(int num_traces, void **trace, char **syms)
/* async-signal unsafe */
file = (char *)mmap(NULL, filesize, PROT_READ, MAP_SHARED, fd, 0);
if (file == MAP_FAILED) {
- perror("mmap");
+ int e = errno;
+ close(fd);
+ fprintf(stderr, "mmap: %s\n", strerror(e));
continue;
}